
obj/user/hello.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 31 00 00 00       	call   800062 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <umain>:
// hello, world
#include <inc/lib.h>

void
umain(int argc, char **argv)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	83 ec 14             	sub    $0x14,%esp
	cprintf("hello, world\n");
  80003d:	68 00 1f 80 00       	push   $0x801f00
  800042:	e8 2a 01 00 00       	call   800171 <cprintf>
	cprintf("i am environment %08x\n", thisenv->env_id);
  800047:	a1 04 40 80 00       	mov    0x804004,%eax
  80004c:	8b 40 48             	mov    0x48(%eax),%eax
  80004f:	83 c4 08             	add    $0x8,%esp
  800052:	50                   	push   %eax
  800053:	68 0e 1f 80 00       	push   $0x801f0e
  800058:	e8 14 01 00 00       	call   800171 <cprintf>
}
  80005d:	83 c4 10             	add    $0x10,%esp
  800060:	c9                   	leave  
  800061:	c3                   	ret    

00800062 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  800062:	f3 0f 1e fb          	endbr32 
  800066:	55                   	push   %ebp
  800067:	89 e5                	mov    %esp,%ebp
  800069:	56                   	push   %esi
  80006a:	53                   	push   %ebx
  80006b:	8b 5d 08             	mov    0x8(%ebp),%ebx
  80006e:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  800071:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  800078:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  80007b:	e8 c6 0a 00 00       	call   800b46 <sys_getenvid>
  800080:	25 ff 03 00 00       	and    $0x3ff,%eax
  800085:	6b c0 7c             	imul   $0x7c,%eax,%eax
  800088:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  80008d:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800092:	85 db                	test   %ebx,%ebx
  800094:	7e 07                	jle    80009d <libmain+0x3b>
		binaryname = argv[0];
  800096:	8b 06                	mov    (%esi),%eax
  800098:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  80009d:	83 ec 08             	sub    $0x8,%esp
  8000a0:	56                   	push   %esi
  8000a1:	53                   	push   %ebx
  8000a2:	e8 8c ff ff ff       	call   800033 <umain>

	// exit gracefully
	exit();
  8000a7:	e8 0a 00 00 00       	call   8000b6 <exit>
}
  8000ac:	83 c4 10             	add    $0x10,%esp
  8000af:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8000b2:	5b                   	pop    %ebx
  8000b3:	5e                   	pop    %esi
  8000b4:	5d                   	pop    %ebp
  8000b5:	c3                   	ret    

008000b6 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  8000b6:	f3 0f 1e fb          	endbr32 
  8000ba:	55                   	push   %ebp
  8000bb:	89 e5                	mov    %esp,%ebp
  8000bd:	83 ec 08             	sub    $0x8,%esp
	close_all();
  8000c0:	e8 c7 0e 00 00       	call   800f8c <close_all>
	sys_env_destroy(0);
  8000c5:	83 ec 0c             	sub    $0xc,%esp
  8000c8:	6a 00                	push   $0x0
  8000ca:	e8 32 0a 00 00       	call   800b01 <sys_env_destroy>
}
  8000cf:	83 c4 10             	add    $0x10,%esp
  8000d2:	c9                   	leave  
  8000d3:	c3                   	ret    

008000d4 <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  8000d4:	f3 0f 1e fb          	endbr32 
  8000d8:	55                   	push   %ebp
  8000d9:	89 e5                	mov    %esp,%ebp
  8000db:	53                   	push   %ebx
  8000dc:	83 ec 04             	sub    $0x4,%esp
  8000df:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  8000e2:	8b 13                	mov    (%ebx),%edx
  8000e4:	8d 42 01             	lea    0x1(%edx),%eax
  8000e7:	89 03                	mov    %eax,(%ebx)
  8000e9:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8000ec:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  8000f0:	3d ff 00 00 00       	cmp    $0xff,%eax
  8000f5:	74 09                	je     800100 <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  8000f7:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  8000fb:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8000fe:	c9                   	leave  
  8000ff:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  800100:	83 ec 08             	sub    $0x8,%esp
  800103:	68 ff 00 00 00       	push   $0xff
  800108:	8d 43 08             	lea    0x8(%ebx),%eax
  80010b:	50                   	push   %eax
  80010c:	e8 ab 09 00 00       	call   800abc <sys_cputs>
		b->idx = 0;
  800111:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  800117:	83 c4 10             	add    $0x10,%esp
  80011a:	eb db                	jmp    8000f7 <putch+0x23>

0080011c <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  80011c:	f3 0f 1e fb          	endbr32 
  800120:	55                   	push   %ebp
  800121:	89 e5                	mov    %esp,%ebp
  800123:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  800129:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  800130:	00 00 00 
	b.cnt = 0;
  800133:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  80013a:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  80013d:	ff 75 0c             	pushl  0xc(%ebp)
  800140:	ff 75 08             	pushl  0x8(%ebp)
  800143:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  800149:	50                   	push   %eax
  80014a:	68 d4 00 80 00       	push   $0x8000d4
  80014f:	e8 20 01 00 00       	call   800274 <vprintfmt>
	sys_cputs(b.buf, b.idx);
  800154:	83 c4 08             	add    $0x8,%esp
  800157:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  80015d:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  800163:	50                   	push   %eax
  800164:	e8 53 09 00 00       	call   800abc <sys_cputs>

	return b.cnt;
}
  800169:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  80016f:	c9                   	leave  
  800170:	c3                   	ret    

00800171 <cprintf>:

int
cprintf(const char *fmt, ...)
{
  800171:	f3 0f 1e fb          	endbr32 
  800175:	55                   	push   %ebp
  800176:	89 e5                	mov    %esp,%ebp
  800178:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  80017b:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  80017e:	50                   	push   %eax
  80017f:	ff 75 08             	pushl  0x8(%ebp)
  800182:	e8 95 ff ff ff       	call   80011c <vcprintf>
	va_end(ap);

	return cnt;
}
  800187:	c9                   	leave  
  800188:	c3                   	ret    

00800189 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  800189:	55                   	push   %ebp
  80018a:	89 e5                	mov    %esp,%ebp
  80018c:	57                   	push   %edi
  80018d:	56                   	push   %esi
  80018e:	53                   	push   %ebx
  80018f:	83 ec 1c             	sub    $0x1c,%esp
  800192:	89 c7                	mov    %eax,%edi
  800194:	89 d6                	mov    %edx,%esi
  800196:	8b 45 08             	mov    0x8(%ebp),%eax
  800199:	8b 55 0c             	mov    0xc(%ebp),%edx
  80019c:	89 d1                	mov    %edx,%ecx
  80019e:	89 c2                	mov    %eax,%edx
  8001a0:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8001a3:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8001a6:	8b 45 10             	mov    0x10(%ebp),%eax
  8001a9:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  8001ac:	89 45 e0             	mov    %eax,-0x20(%ebp)
  8001af:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  8001b6:	39 c2                	cmp    %eax,%edx
  8001b8:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  8001bb:	72 3e                	jb     8001fb <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  8001bd:	83 ec 0c             	sub    $0xc,%esp
  8001c0:	ff 75 18             	pushl  0x18(%ebp)
  8001c3:	83 eb 01             	sub    $0x1,%ebx
  8001c6:	53                   	push   %ebx
  8001c7:	50                   	push   %eax
  8001c8:	83 ec 08             	sub    $0x8,%esp
  8001cb:	ff 75 e4             	pushl  -0x1c(%ebp)
  8001ce:	ff 75 e0             	pushl  -0x20(%ebp)
  8001d1:	ff 75 dc             	pushl  -0x24(%ebp)
  8001d4:	ff 75 d8             	pushl  -0x28(%ebp)
  8001d7:	e8 b4 1a 00 00       	call   801c90 <__udivdi3>
  8001dc:	83 c4 18             	add    $0x18,%esp
  8001df:	52                   	push   %edx
  8001e0:	50                   	push   %eax
  8001e1:	89 f2                	mov    %esi,%edx
  8001e3:	89 f8                	mov    %edi,%eax
  8001e5:	e8 9f ff ff ff       	call   800189 <printnum>
  8001ea:	83 c4 20             	add    $0x20,%esp
  8001ed:	eb 13                	jmp    800202 <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  8001ef:	83 ec 08             	sub    $0x8,%esp
  8001f2:	56                   	push   %esi
  8001f3:	ff 75 18             	pushl  0x18(%ebp)
  8001f6:	ff d7                	call   *%edi
  8001f8:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  8001fb:	83 eb 01             	sub    $0x1,%ebx
  8001fe:	85 db                	test   %ebx,%ebx
  800200:	7f ed                	jg     8001ef <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  800202:	83 ec 08             	sub    $0x8,%esp
  800205:	56                   	push   %esi
  800206:	83 ec 04             	sub    $0x4,%esp
  800209:	ff 75 e4             	pushl  -0x1c(%ebp)
  80020c:	ff 75 e0             	pushl  -0x20(%ebp)
  80020f:	ff 75 dc             	pushl  -0x24(%ebp)
  800212:	ff 75 d8             	pushl  -0x28(%ebp)
  800215:	e8 86 1b 00 00       	call   801da0 <__umoddi3>
  80021a:	83 c4 14             	add    $0x14,%esp
  80021d:	0f be 80 2f 1f 80 00 	movsbl 0x801f2f(%eax),%eax
  800224:	50                   	push   %eax
  800225:	ff d7                	call   *%edi
}
  800227:	83 c4 10             	add    $0x10,%esp
  80022a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80022d:	5b                   	pop    %ebx
  80022e:	5e                   	pop    %esi
  80022f:	5f                   	pop    %edi
  800230:	5d                   	pop    %ebp
  800231:	c3                   	ret    

00800232 <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  800232:	f3 0f 1e fb          	endbr32 
  800236:	55                   	push   %ebp
  800237:	89 e5                	mov    %esp,%ebp
  800239:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  80023c:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  800240:	8b 10                	mov    (%eax),%edx
  800242:	3b 50 04             	cmp    0x4(%eax),%edx
  800245:	73 0a                	jae    800251 <sprintputch+0x1f>
		*b->buf++ = ch;
  800247:	8d 4a 01             	lea    0x1(%edx),%ecx
  80024a:	89 08                	mov    %ecx,(%eax)
  80024c:	8b 45 08             	mov    0x8(%ebp),%eax
  80024f:	88 02                	mov    %al,(%edx)
}
  800251:	5d                   	pop    %ebp
  800252:	c3                   	ret    

00800253 <printfmt>:
{
  800253:	f3 0f 1e fb          	endbr32 
  800257:	55                   	push   %ebp
  800258:	89 e5                	mov    %esp,%ebp
  80025a:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  80025d:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  800260:	50                   	push   %eax
  800261:	ff 75 10             	pushl  0x10(%ebp)
  800264:	ff 75 0c             	pushl  0xc(%ebp)
  800267:	ff 75 08             	pushl  0x8(%ebp)
  80026a:	e8 05 00 00 00       	call   800274 <vprintfmt>
}
  80026f:	83 c4 10             	add    $0x10,%esp
  800272:	c9                   	leave  
  800273:	c3                   	ret    

00800274 <vprintfmt>:
{
  800274:	f3 0f 1e fb          	endbr32 
  800278:	55                   	push   %ebp
  800279:	89 e5                	mov    %esp,%ebp
  80027b:	57                   	push   %edi
  80027c:	56                   	push   %esi
  80027d:	53                   	push   %ebx
  80027e:	83 ec 3c             	sub    $0x3c,%esp
  800281:	8b 75 08             	mov    0x8(%ebp),%esi
  800284:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  800287:	8b 7d 10             	mov    0x10(%ebp),%edi
  80028a:	e9 5d 03 00 00       	jmp    8005ec <vprintfmt+0x378>
		padc = ' ';
  80028f:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  800293:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  80029a:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  8002a1:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  8002a8:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  8002ad:	8d 47 01             	lea    0x1(%edi),%eax
  8002b0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8002b3:	0f b6 17             	movzbl (%edi),%edx
  8002b6:	8d 42 dd             	lea    -0x23(%edx),%eax
  8002b9:	3c 55                	cmp    $0x55,%al
  8002bb:	0f 87 ae 03 00 00    	ja     80066f <vprintfmt+0x3fb>
  8002c1:	0f b6 c0             	movzbl %al,%eax
  8002c4:	3e ff 24 85 80 20 80 	notrack jmp *0x802080(,%eax,4)
  8002cb:	00 
  8002cc:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  8002cf:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  8002d3:	eb d8                	jmp    8002ad <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8002d5:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  8002d8:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  8002dc:	eb cf                	jmp    8002ad <vprintfmt+0x39>
  8002de:	0f b6 d2             	movzbl %dl,%edx
  8002e1:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  8002e4:	b8 00 00 00 00       	mov    $0x0,%eax
  8002e9:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  8002ec:	8d 04 80             	lea    (%eax,%eax,4),%eax
  8002ef:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  8002f3:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  8002f6:	8d 4a d0             	lea    -0x30(%edx),%ecx
  8002f9:	83 f9 09             	cmp    $0x9,%ecx
  8002fc:	77 55                	ja     800353 <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  8002fe:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  800301:	eb e9                	jmp    8002ec <vprintfmt+0x78>
			precision = va_arg(ap, int);
  800303:	8b 45 14             	mov    0x14(%ebp),%eax
  800306:	8b 00                	mov    (%eax),%eax
  800308:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80030b:	8b 45 14             	mov    0x14(%ebp),%eax
  80030e:	8d 40 04             	lea    0x4(%eax),%eax
  800311:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  800314:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  800317:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  80031b:	79 90                	jns    8002ad <vprintfmt+0x39>
				width = precision, precision = -1;
  80031d:	8b 45 d8             	mov    -0x28(%ebp),%eax
  800320:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  800323:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  80032a:	eb 81                	jmp    8002ad <vprintfmt+0x39>
  80032c:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  80032f:	85 c0                	test   %eax,%eax
  800331:	ba 00 00 00 00       	mov    $0x0,%edx
  800336:	0f 49 d0             	cmovns %eax,%edx
  800339:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  80033c:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80033f:	e9 69 ff ff ff       	jmp    8002ad <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  800344:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800347:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  80034e:	e9 5a ff ff ff       	jmp    8002ad <vprintfmt+0x39>
  800353:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800356:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800359:	eb bc                	jmp    800317 <vprintfmt+0xa3>
			lflag++;
  80035b:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  80035e:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  800361:	e9 47 ff ff ff       	jmp    8002ad <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  800366:	8b 45 14             	mov    0x14(%ebp),%eax
  800369:	8d 78 04             	lea    0x4(%eax),%edi
  80036c:	83 ec 08             	sub    $0x8,%esp
  80036f:	53                   	push   %ebx
  800370:	ff 30                	pushl  (%eax)
  800372:	ff d6                	call   *%esi
			break;
  800374:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  800377:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  80037a:	e9 6a 02 00 00       	jmp    8005e9 <vprintfmt+0x375>
			err = va_arg(ap, int);
  80037f:	8b 45 14             	mov    0x14(%ebp),%eax
  800382:	8d 78 04             	lea    0x4(%eax),%edi
  800385:	8b 00                	mov    (%eax),%eax
  800387:	99                   	cltd   
  800388:	31 d0                	xor    %edx,%eax
  80038a:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  80038c:	83 f8 0f             	cmp    $0xf,%eax
  80038f:	7f 23                	jg     8003b4 <vprintfmt+0x140>
  800391:	8b 14 85 e0 21 80 00 	mov    0x8021e0(,%eax,4),%edx
  800398:	85 d2                	test   %edx,%edx
  80039a:	74 18                	je     8003b4 <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  80039c:	52                   	push   %edx
  80039d:	68 11 23 80 00       	push   $0x802311
  8003a2:	53                   	push   %ebx
  8003a3:	56                   	push   %esi
  8003a4:	e8 aa fe ff ff       	call   800253 <printfmt>
  8003a9:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003ac:	89 7d 14             	mov    %edi,0x14(%ebp)
  8003af:	e9 35 02 00 00       	jmp    8005e9 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  8003b4:	50                   	push   %eax
  8003b5:	68 47 1f 80 00       	push   $0x801f47
  8003ba:	53                   	push   %ebx
  8003bb:	56                   	push   %esi
  8003bc:	e8 92 fe ff ff       	call   800253 <printfmt>
  8003c1:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  8003c4:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  8003c7:	e9 1d 02 00 00       	jmp    8005e9 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  8003cc:	8b 45 14             	mov    0x14(%ebp),%eax
  8003cf:	83 c0 04             	add    $0x4,%eax
  8003d2:	89 45 c8             	mov    %eax,-0x38(%ebp)
  8003d5:	8b 45 14             	mov    0x14(%ebp),%eax
  8003d8:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  8003da:	85 d2                	test   %edx,%edx
  8003dc:	b8 40 1f 80 00       	mov    $0x801f40,%eax
  8003e1:	0f 45 c2             	cmovne %edx,%eax
  8003e4:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  8003e7:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8003eb:	7e 06                	jle    8003f3 <vprintfmt+0x17f>
  8003ed:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  8003f1:	75 0d                	jne    800400 <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  8003f3:	8b 45 cc             	mov    -0x34(%ebp),%eax
  8003f6:	89 c7                	mov    %eax,%edi
  8003f8:	03 45 d4             	add    -0x2c(%ebp),%eax
  8003fb:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8003fe:	eb 55                	jmp    800455 <vprintfmt+0x1e1>
  800400:	83 ec 08             	sub    $0x8,%esp
  800403:	ff 75 d8             	pushl  -0x28(%ebp)
  800406:	ff 75 cc             	pushl  -0x34(%ebp)
  800409:	e8 15 03 00 00       	call   800723 <strnlen>
  80040e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  800411:	29 c2                	sub    %eax,%edx
  800413:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  800416:	83 c4 10             	add    $0x10,%esp
  800419:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  80041b:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  80041f:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  800422:	85 ff                	test   %edi,%edi
  800424:	7e 11                	jle    800437 <vprintfmt+0x1c3>
					putch(padc, putdat);
  800426:	83 ec 08             	sub    $0x8,%esp
  800429:	53                   	push   %ebx
  80042a:	ff 75 d4             	pushl  -0x2c(%ebp)
  80042d:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  80042f:	83 ef 01             	sub    $0x1,%edi
  800432:	83 c4 10             	add    $0x10,%esp
  800435:	eb eb                	jmp    800422 <vprintfmt+0x1ae>
  800437:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  80043a:	85 d2                	test   %edx,%edx
  80043c:	b8 00 00 00 00       	mov    $0x0,%eax
  800441:	0f 49 c2             	cmovns %edx,%eax
  800444:	29 c2                	sub    %eax,%edx
  800446:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  800449:	eb a8                	jmp    8003f3 <vprintfmt+0x17f>
					putch(ch, putdat);
  80044b:	83 ec 08             	sub    $0x8,%esp
  80044e:	53                   	push   %ebx
  80044f:	52                   	push   %edx
  800450:	ff d6                	call   *%esi
  800452:	83 c4 10             	add    $0x10,%esp
  800455:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800458:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  80045a:	83 c7 01             	add    $0x1,%edi
  80045d:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  800461:	0f be d0             	movsbl %al,%edx
  800464:	85 d2                	test   %edx,%edx
  800466:	74 4b                	je     8004b3 <vprintfmt+0x23f>
  800468:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  80046c:	78 06                	js     800474 <vprintfmt+0x200>
  80046e:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  800472:	78 1e                	js     800492 <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  800474:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  800478:	74 d1                	je     80044b <vprintfmt+0x1d7>
  80047a:	0f be c0             	movsbl %al,%eax
  80047d:	83 e8 20             	sub    $0x20,%eax
  800480:	83 f8 5e             	cmp    $0x5e,%eax
  800483:	76 c6                	jbe    80044b <vprintfmt+0x1d7>
					putch('?', putdat);
  800485:	83 ec 08             	sub    $0x8,%esp
  800488:	53                   	push   %ebx
  800489:	6a 3f                	push   $0x3f
  80048b:	ff d6                	call   *%esi
  80048d:	83 c4 10             	add    $0x10,%esp
  800490:	eb c3                	jmp    800455 <vprintfmt+0x1e1>
  800492:	89 cf                	mov    %ecx,%edi
  800494:	eb 0e                	jmp    8004a4 <vprintfmt+0x230>
				putch(' ', putdat);
  800496:	83 ec 08             	sub    $0x8,%esp
  800499:	53                   	push   %ebx
  80049a:	6a 20                	push   $0x20
  80049c:	ff d6                	call   *%esi
			for (; width > 0; width--)
  80049e:	83 ef 01             	sub    $0x1,%edi
  8004a1:	83 c4 10             	add    $0x10,%esp
  8004a4:	85 ff                	test   %edi,%edi
  8004a6:	7f ee                	jg     800496 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  8004a8:	8b 45 c8             	mov    -0x38(%ebp),%eax
  8004ab:	89 45 14             	mov    %eax,0x14(%ebp)
  8004ae:	e9 36 01 00 00       	jmp    8005e9 <vprintfmt+0x375>
  8004b3:	89 cf                	mov    %ecx,%edi
  8004b5:	eb ed                	jmp    8004a4 <vprintfmt+0x230>
	if (lflag >= 2)
  8004b7:	83 f9 01             	cmp    $0x1,%ecx
  8004ba:	7f 1f                	jg     8004db <vprintfmt+0x267>
	else if (lflag)
  8004bc:	85 c9                	test   %ecx,%ecx
  8004be:	74 67                	je     800527 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  8004c0:	8b 45 14             	mov    0x14(%ebp),%eax
  8004c3:	8b 00                	mov    (%eax),%eax
  8004c5:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8004c8:	89 c1                	mov    %eax,%ecx
  8004ca:	c1 f9 1f             	sar    $0x1f,%ecx
  8004cd:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  8004d0:	8b 45 14             	mov    0x14(%ebp),%eax
  8004d3:	8d 40 04             	lea    0x4(%eax),%eax
  8004d6:	89 45 14             	mov    %eax,0x14(%ebp)
  8004d9:	eb 17                	jmp    8004f2 <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  8004db:	8b 45 14             	mov    0x14(%ebp),%eax
  8004de:	8b 50 04             	mov    0x4(%eax),%edx
  8004e1:	8b 00                	mov    (%eax),%eax
  8004e3:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8004e6:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8004e9:	8b 45 14             	mov    0x14(%ebp),%eax
  8004ec:	8d 40 08             	lea    0x8(%eax),%eax
  8004ef:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  8004f2:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8004f5:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  8004f8:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  8004fd:	85 c9                	test   %ecx,%ecx
  8004ff:	0f 89 ca 00 00 00    	jns    8005cf <vprintfmt+0x35b>
				putch('-', putdat);
  800505:	83 ec 08             	sub    $0x8,%esp
  800508:	53                   	push   %ebx
  800509:	6a 2d                	push   $0x2d
  80050b:	ff d6                	call   *%esi
				num = -(long long) num;
  80050d:	8b 55 d8             	mov    -0x28(%ebp),%edx
  800510:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  800513:	f7 da                	neg    %edx
  800515:	83 d1 00             	adc    $0x0,%ecx
  800518:	f7 d9                	neg    %ecx
  80051a:	83 c4 10             	add    $0x10,%esp
			base = 10;
  80051d:	b8 0a 00 00 00       	mov    $0xa,%eax
  800522:	e9 a8 00 00 00       	jmp    8005cf <vprintfmt+0x35b>
		return va_arg(*ap, int);
  800527:	8b 45 14             	mov    0x14(%ebp),%eax
  80052a:	8b 00                	mov    (%eax),%eax
  80052c:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80052f:	99                   	cltd   
  800530:	89 55 dc             	mov    %edx,-0x24(%ebp)
  800533:	8b 45 14             	mov    0x14(%ebp),%eax
  800536:	8d 40 04             	lea    0x4(%eax),%eax
  800539:	89 45 14             	mov    %eax,0x14(%ebp)
  80053c:	eb b4                	jmp    8004f2 <vprintfmt+0x27e>
	if (lflag >= 2)
  80053e:	83 f9 01             	cmp    $0x1,%ecx
  800541:	7f 1b                	jg     80055e <vprintfmt+0x2ea>
	else if (lflag)
  800543:	85 c9                	test   %ecx,%ecx
  800545:	74 2c                	je     800573 <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800547:	8b 45 14             	mov    0x14(%ebp),%eax
  80054a:	8b 10                	mov    (%eax),%edx
  80054c:	b9 00 00 00 00       	mov    $0x0,%ecx
  800551:	8d 40 04             	lea    0x4(%eax),%eax
  800554:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800557:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  80055c:	eb 71                	jmp    8005cf <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  80055e:	8b 45 14             	mov    0x14(%ebp),%eax
  800561:	8b 10                	mov    (%eax),%edx
  800563:	8b 48 04             	mov    0x4(%eax),%ecx
  800566:	8d 40 08             	lea    0x8(%eax),%eax
  800569:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80056c:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  800571:	eb 5c                	jmp    8005cf <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800573:	8b 45 14             	mov    0x14(%ebp),%eax
  800576:	8b 10                	mov    (%eax),%edx
  800578:	b9 00 00 00 00       	mov    $0x0,%ecx
  80057d:	8d 40 04             	lea    0x4(%eax),%eax
  800580:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800583:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  800588:	eb 45                	jmp    8005cf <vprintfmt+0x35b>
			putch('X', putdat);
  80058a:	83 ec 08             	sub    $0x8,%esp
  80058d:	53                   	push   %ebx
  80058e:	6a 58                	push   $0x58
  800590:	ff d6                	call   *%esi
			putch('X', putdat);
  800592:	83 c4 08             	add    $0x8,%esp
  800595:	53                   	push   %ebx
  800596:	6a 58                	push   $0x58
  800598:	ff d6                	call   *%esi
			putch('X', putdat);
  80059a:	83 c4 08             	add    $0x8,%esp
  80059d:	53                   	push   %ebx
  80059e:	6a 58                	push   $0x58
  8005a0:	ff d6                	call   *%esi
			break;
  8005a2:	83 c4 10             	add    $0x10,%esp
  8005a5:	eb 42                	jmp    8005e9 <vprintfmt+0x375>
			putch('0', putdat);
  8005a7:	83 ec 08             	sub    $0x8,%esp
  8005aa:	53                   	push   %ebx
  8005ab:	6a 30                	push   $0x30
  8005ad:	ff d6                	call   *%esi
			putch('x', putdat);
  8005af:	83 c4 08             	add    $0x8,%esp
  8005b2:	53                   	push   %ebx
  8005b3:	6a 78                	push   $0x78
  8005b5:	ff d6                	call   *%esi
			num = (unsigned long long)
  8005b7:	8b 45 14             	mov    0x14(%ebp),%eax
  8005ba:	8b 10                	mov    (%eax),%edx
  8005bc:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  8005c1:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  8005c4:	8d 40 04             	lea    0x4(%eax),%eax
  8005c7:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8005ca:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  8005cf:	83 ec 0c             	sub    $0xc,%esp
  8005d2:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  8005d6:	57                   	push   %edi
  8005d7:	ff 75 d4             	pushl  -0x2c(%ebp)
  8005da:	50                   	push   %eax
  8005db:	51                   	push   %ecx
  8005dc:	52                   	push   %edx
  8005dd:	89 da                	mov    %ebx,%edx
  8005df:	89 f0                	mov    %esi,%eax
  8005e1:	e8 a3 fb ff ff       	call   800189 <printnum>
			break;
  8005e6:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  8005e9:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  8005ec:	83 c7 01             	add    $0x1,%edi
  8005ef:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  8005f3:	83 f8 25             	cmp    $0x25,%eax
  8005f6:	0f 84 93 fc ff ff    	je     80028f <vprintfmt+0x1b>
			if (ch == '\0')
  8005fc:	85 c0                	test   %eax,%eax
  8005fe:	0f 84 8b 00 00 00    	je     80068f <vprintfmt+0x41b>
			putch(ch, putdat);
  800604:	83 ec 08             	sub    $0x8,%esp
  800607:	53                   	push   %ebx
  800608:	50                   	push   %eax
  800609:	ff d6                	call   *%esi
  80060b:	83 c4 10             	add    $0x10,%esp
  80060e:	eb dc                	jmp    8005ec <vprintfmt+0x378>
	if (lflag >= 2)
  800610:	83 f9 01             	cmp    $0x1,%ecx
  800613:	7f 1b                	jg     800630 <vprintfmt+0x3bc>
	else if (lflag)
  800615:	85 c9                	test   %ecx,%ecx
  800617:	74 2c                	je     800645 <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  800619:	8b 45 14             	mov    0x14(%ebp),%eax
  80061c:	8b 10                	mov    (%eax),%edx
  80061e:	b9 00 00 00 00       	mov    $0x0,%ecx
  800623:	8d 40 04             	lea    0x4(%eax),%eax
  800626:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800629:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  80062e:	eb 9f                	jmp    8005cf <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800630:	8b 45 14             	mov    0x14(%ebp),%eax
  800633:	8b 10                	mov    (%eax),%edx
  800635:	8b 48 04             	mov    0x4(%eax),%ecx
  800638:	8d 40 08             	lea    0x8(%eax),%eax
  80063b:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80063e:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  800643:	eb 8a                	jmp    8005cf <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  800645:	8b 45 14             	mov    0x14(%ebp),%eax
  800648:	8b 10                	mov    (%eax),%edx
  80064a:	b9 00 00 00 00       	mov    $0x0,%ecx
  80064f:	8d 40 04             	lea    0x4(%eax),%eax
  800652:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800655:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  80065a:	e9 70 ff ff ff       	jmp    8005cf <vprintfmt+0x35b>
			putch(ch, putdat);
  80065f:	83 ec 08             	sub    $0x8,%esp
  800662:	53                   	push   %ebx
  800663:	6a 25                	push   $0x25
  800665:	ff d6                	call   *%esi
			break;
  800667:	83 c4 10             	add    $0x10,%esp
  80066a:	e9 7a ff ff ff       	jmp    8005e9 <vprintfmt+0x375>
			putch('%', putdat);
  80066f:	83 ec 08             	sub    $0x8,%esp
  800672:	53                   	push   %ebx
  800673:	6a 25                	push   $0x25
  800675:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800677:	83 c4 10             	add    $0x10,%esp
  80067a:	89 f8                	mov    %edi,%eax
  80067c:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  800680:	74 05                	je     800687 <vprintfmt+0x413>
  800682:	83 e8 01             	sub    $0x1,%eax
  800685:	eb f5                	jmp    80067c <vprintfmt+0x408>
  800687:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80068a:	e9 5a ff ff ff       	jmp    8005e9 <vprintfmt+0x375>
}
  80068f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800692:	5b                   	pop    %ebx
  800693:	5e                   	pop    %esi
  800694:	5f                   	pop    %edi
  800695:	5d                   	pop    %ebp
  800696:	c3                   	ret    

00800697 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  800697:	f3 0f 1e fb          	endbr32 
  80069b:	55                   	push   %ebp
  80069c:	89 e5                	mov    %esp,%ebp
  80069e:	83 ec 18             	sub    $0x18,%esp
  8006a1:	8b 45 08             	mov    0x8(%ebp),%eax
  8006a4:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  8006a7:	89 45 ec             	mov    %eax,-0x14(%ebp)
  8006aa:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  8006ae:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  8006b1:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  8006b8:	85 c0                	test   %eax,%eax
  8006ba:	74 26                	je     8006e2 <vsnprintf+0x4b>
  8006bc:	85 d2                	test   %edx,%edx
  8006be:	7e 22                	jle    8006e2 <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  8006c0:	ff 75 14             	pushl  0x14(%ebp)
  8006c3:	ff 75 10             	pushl  0x10(%ebp)
  8006c6:	8d 45 ec             	lea    -0x14(%ebp),%eax
  8006c9:	50                   	push   %eax
  8006ca:	68 32 02 80 00       	push   $0x800232
  8006cf:	e8 a0 fb ff ff       	call   800274 <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  8006d4:	8b 45 ec             	mov    -0x14(%ebp),%eax
  8006d7:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  8006da:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8006dd:	83 c4 10             	add    $0x10,%esp
}
  8006e0:	c9                   	leave  
  8006e1:	c3                   	ret    
		return -E_INVAL;
  8006e2:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8006e7:	eb f7                	jmp    8006e0 <vsnprintf+0x49>

008006e9 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  8006e9:	f3 0f 1e fb          	endbr32 
  8006ed:	55                   	push   %ebp
  8006ee:	89 e5                	mov    %esp,%ebp
  8006f0:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  8006f3:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  8006f6:	50                   	push   %eax
  8006f7:	ff 75 10             	pushl  0x10(%ebp)
  8006fa:	ff 75 0c             	pushl  0xc(%ebp)
  8006fd:	ff 75 08             	pushl  0x8(%ebp)
  800700:	e8 92 ff ff ff       	call   800697 <vsnprintf>
	va_end(ap);

	return rc;
}
  800705:	c9                   	leave  
  800706:	c3                   	ret    

00800707 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  800707:	f3 0f 1e fb          	endbr32 
  80070b:	55                   	push   %ebp
  80070c:	89 e5                	mov    %esp,%ebp
  80070e:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  800711:	b8 00 00 00 00       	mov    $0x0,%eax
  800716:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  80071a:	74 05                	je     800721 <strlen+0x1a>
		n++;
  80071c:	83 c0 01             	add    $0x1,%eax
  80071f:	eb f5                	jmp    800716 <strlen+0xf>
	return n;
}
  800721:	5d                   	pop    %ebp
  800722:	c3                   	ret    

00800723 <strnlen>:

int
strnlen(const char *s, size_t size)
{
  800723:	f3 0f 1e fb          	endbr32 
  800727:	55                   	push   %ebp
  800728:	89 e5                	mov    %esp,%ebp
  80072a:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80072d:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  800730:	b8 00 00 00 00       	mov    $0x0,%eax
  800735:	39 d0                	cmp    %edx,%eax
  800737:	74 0d                	je     800746 <strnlen+0x23>
  800739:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  80073d:	74 05                	je     800744 <strnlen+0x21>
		n++;
  80073f:	83 c0 01             	add    $0x1,%eax
  800742:	eb f1                	jmp    800735 <strnlen+0x12>
  800744:	89 c2                	mov    %eax,%edx
	return n;
}
  800746:	89 d0                	mov    %edx,%eax
  800748:	5d                   	pop    %ebp
  800749:	c3                   	ret    

0080074a <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  80074a:	f3 0f 1e fb          	endbr32 
  80074e:	55                   	push   %ebp
  80074f:	89 e5                	mov    %esp,%ebp
  800751:	53                   	push   %ebx
  800752:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800755:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800758:	b8 00 00 00 00       	mov    $0x0,%eax
  80075d:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  800761:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  800764:	83 c0 01             	add    $0x1,%eax
  800767:	84 d2                	test   %dl,%dl
  800769:	75 f2                	jne    80075d <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  80076b:	89 c8                	mov    %ecx,%eax
  80076d:	5b                   	pop    %ebx
  80076e:	5d                   	pop    %ebp
  80076f:	c3                   	ret    

00800770 <strcat>:

char *
strcat(char *dst, const char *src)
{
  800770:	f3 0f 1e fb          	endbr32 
  800774:	55                   	push   %ebp
  800775:	89 e5                	mov    %esp,%ebp
  800777:	53                   	push   %ebx
  800778:	83 ec 10             	sub    $0x10,%esp
  80077b:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  80077e:	53                   	push   %ebx
  80077f:	e8 83 ff ff ff       	call   800707 <strlen>
  800784:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  800787:	ff 75 0c             	pushl  0xc(%ebp)
  80078a:	01 d8                	add    %ebx,%eax
  80078c:	50                   	push   %eax
  80078d:	e8 b8 ff ff ff       	call   80074a <strcpy>
	return dst;
}
  800792:	89 d8                	mov    %ebx,%eax
  800794:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800797:	c9                   	leave  
  800798:	c3                   	ret    

00800799 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  800799:	f3 0f 1e fb          	endbr32 
  80079d:	55                   	push   %ebp
  80079e:	89 e5                	mov    %esp,%ebp
  8007a0:	56                   	push   %esi
  8007a1:	53                   	push   %ebx
  8007a2:	8b 75 08             	mov    0x8(%ebp),%esi
  8007a5:	8b 55 0c             	mov    0xc(%ebp),%edx
  8007a8:	89 f3                	mov    %esi,%ebx
  8007aa:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  8007ad:	89 f0                	mov    %esi,%eax
  8007af:	39 d8                	cmp    %ebx,%eax
  8007b1:	74 11                	je     8007c4 <strncpy+0x2b>
		*dst++ = *src;
  8007b3:	83 c0 01             	add    $0x1,%eax
  8007b6:	0f b6 0a             	movzbl (%edx),%ecx
  8007b9:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  8007bc:	80 f9 01             	cmp    $0x1,%cl
  8007bf:	83 da ff             	sbb    $0xffffffff,%edx
  8007c2:	eb eb                	jmp    8007af <strncpy+0x16>
	}
	return ret;
}
  8007c4:	89 f0                	mov    %esi,%eax
  8007c6:	5b                   	pop    %ebx
  8007c7:	5e                   	pop    %esi
  8007c8:	5d                   	pop    %ebp
  8007c9:	c3                   	ret    

008007ca <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  8007ca:	f3 0f 1e fb          	endbr32 
  8007ce:	55                   	push   %ebp
  8007cf:	89 e5                	mov    %esp,%ebp
  8007d1:	56                   	push   %esi
  8007d2:	53                   	push   %ebx
  8007d3:	8b 75 08             	mov    0x8(%ebp),%esi
  8007d6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8007d9:	8b 55 10             	mov    0x10(%ebp),%edx
  8007dc:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  8007de:	85 d2                	test   %edx,%edx
  8007e0:	74 21                	je     800803 <strlcpy+0x39>
  8007e2:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  8007e6:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  8007e8:	39 c2                	cmp    %eax,%edx
  8007ea:	74 14                	je     800800 <strlcpy+0x36>
  8007ec:	0f b6 19             	movzbl (%ecx),%ebx
  8007ef:	84 db                	test   %bl,%bl
  8007f1:	74 0b                	je     8007fe <strlcpy+0x34>
			*dst++ = *src++;
  8007f3:	83 c1 01             	add    $0x1,%ecx
  8007f6:	83 c2 01             	add    $0x1,%edx
  8007f9:	88 5a ff             	mov    %bl,-0x1(%edx)
  8007fc:	eb ea                	jmp    8007e8 <strlcpy+0x1e>
  8007fe:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  800800:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  800803:	29 f0                	sub    %esi,%eax
}
  800805:	5b                   	pop    %ebx
  800806:	5e                   	pop    %esi
  800807:	5d                   	pop    %ebp
  800808:	c3                   	ret    

00800809 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  800809:	f3 0f 1e fb          	endbr32 
  80080d:	55                   	push   %ebp
  80080e:	89 e5                	mov    %esp,%ebp
  800810:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800813:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  800816:	0f b6 01             	movzbl (%ecx),%eax
  800819:	84 c0                	test   %al,%al
  80081b:	74 0c                	je     800829 <strcmp+0x20>
  80081d:	3a 02                	cmp    (%edx),%al
  80081f:	75 08                	jne    800829 <strcmp+0x20>
		p++, q++;
  800821:	83 c1 01             	add    $0x1,%ecx
  800824:	83 c2 01             	add    $0x1,%edx
  800827:	eb ed                	jmp    800816 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  800829:	0f b6 c0             	movzbl %al,%eax
  80082c:	0f b6 12             	movzbl (%edx),%edx
  80082f:	29 d0                	sub    %edx,%eax
}
  800831:	5d                   	pop    %ebp
  800832:	c3                   	ret    

00800833 <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  800833:	f3 0f 1e fb          	endbr32 
  800837:	55                   	push   %ebp
  800838:	89 e5                	mov    %esp,%ebp
  80083a:	53                   	push   %ebx
  80083b:	8b 45 08             	mov    0x8(%ebp),%eax
  80083e:	8b 55 0c             	mov    0xc(%ebp),%edx
  800841:	89 c3                	mov    %eax,%ebx
  800843:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800846:	eb 06                	jmp    80084e <strncmp+0x1b>
		n--, p++, q++;
  800848:	83 c0 01             	add    $0x1,%eax
  80084b:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  80084e:	39 d8                	cmp    %ebx,%eax
  800850:	74 16                	je     800868 <strncmp+0x35>
  800852:	0f b6 08             	movzbl (%eax),%ecx
  800855:	84 c9                	test   %cl,%cl
  800857:	74 04                	je     80085d <strncmp+0x2a>
  800859:	3a 0a                	cmp    (%edx),%cl
  80085b:	74 eb                	je     800848 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  80085d:	0f b6 00             	movzbl (%eax),%eax
  800860:	0f b6 12             	movzbl (%edx),%edx
  800863:	29 d0                	sub    %edx,%eax
}
  800865:	5b                   	pop    %ebx
  800866:	5d                   	pop    %ebp
  800867:	c3                   	ret    
		return 0;
  800868:	b8 00 00 00 00       	mov    $0x0,%eax
  80086d:	eb f6                	jmp    800865 <strncmp+0x32>

0080086f <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  80086f:	f3 0f 1e fb          	endbr32 
  800873:	55                   	push   %ebp
  800874:	89 e5                	mov    %esp,%ebp
  800876:	8b 45 08             	mov    0x8(%ebp),%eax
  800879:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80087d:	0f b6 10             	movzbl (%eax),%edx
  800880:	84 d2                	test   %dl,%dl
  800882:	74 09                	je     80088d <strchr+0x1e>
		if (*s == c)
  800884:	38 ca                	cmp    %cl,%dl
  800886:	74 0a                	je     800892 <strchr+0x23>
	for (; *s; s++)
  800888:	83 c0 01             	add    $0x1,%eax
  80088b:	eb f0                	jmp    80087d <strchr+0xe>
			return (char *) s;
	return 0;
  80088d:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800892:	5d                   	pop    %ebp
  800893:	c3                   	ret    

00800894 <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  800894:	f3 0f 1e fb          	endbr32 
  800898:	55                   	push   %ebp
  800899:	89 e5                	mov    %esp,%ebp
  80089b:	8b 45 08             	mov    0x8(%ebp),%eax
  80089e:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  8008a2:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  8008a5:	38 ca                	cmp    %cl,%dl
  8008a7:	74 09                	je     8008b2 <strfind+0x1e>
  8008a9:	84 d2                	test   %dl,%dl
  8008ab:	74 05                	je     8008b2 <strfind+0x1e>
	for (; *s; s++)
  8008ad:	83 c0 01             	add    $0x1,%eax
  8008b0:	eb f0                	jmp    8008a2 <strfind+0xe>
			break;
	return (char *) s;
}
  8008b2:	5d                   	pop    %ebp
  8008b3:	c3                   	ret    

008008b4 <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  8008b4:	f3 0f 1e fb          	endbr32 
  8008b8:	55                   	push   %ebp
  8008b9:	89 e5                	mov    %esp,%ebp
  8008bb:	57                   	push   %edi
  8008bc:	56                   	push   %esi
  8008bd:	53                   	push   %ebx
  8008be:	8b 7d 08             	mov    0x8(%ebp),%edi
  8008c1:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  8008c4:	85 c9                	test   %ecx,%ecx
  8008c6:	74 31                	je     8008f9 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  8008c8:	89 f8                	mov    %edi,%eax
  8008ca:	09 c8                	or     %ecx,%eax
  8008cc:	a8 03                	test   $0x3,%al
  8008ce:	75 23                	jne    8008f3 <memset+0x3f>
		c &= 0xFF;
  8008d0:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  8008d4:	89 d3                	mov    %edx,%ebx
  8008d6:	c1 e3 08             	shl    $0x8,%ebx
  8008d9:	89 d0                	mov    %edx,%eax
  8008db:	c1 e0 18             	shl    $0x18,%eax
  8008de:	89 d6                	mov    %edx,%esi
  8008e0:	c1 e6 10             	shl    $0x10,%esi
  8008e3:	09 f0                	or     %esi,%eax
  8008e5:	09 c2                	or     %eax,%edx
  8008e7:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  8008e9:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  8008ec:	89 d0                	mov    %edx,%eax
  8008ee:	fc                   	cld    
  8008ef:	f3 ab                	rep stos %eax,%es:(%edi)
  8008f1:	eb 06                	jmp    8008f9 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  8008f3:	8b 45 0c             	mov    0xc(%ebp),%eax
  8008f6:	fc                   	cld    
  8008f7:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  8008f9:	89 f8                	mov    %edi,%eax
  8008fb:	5b                   	pop    %ebx
  8008fc:	5e                   	pop    %esi
  8008fd:	5f                   	pop    %edi
  8008fe:	5d                   	pop    %ebp
  8008ff:	c3                   	ret    

00800900 <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  800900:	f3 0f 1e fb          	endbr32 
  800904:	55                   	push   %ebp
  800905:	89 e5                	mov    %esp,%ebp
  800907:	57                   	push   %edi
  800908:	56                   	push   %esi
  800909:	8b 45 08             	mov    0x8(%ebp),%eax
  80090c:	8b 75 0c             	mov    0xc(%ebp),%esi
  80090f:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  800912:	39 c6                	cmp    %eax,%esi
  800914:	73 32                	jae    800948 <memmove+0x48>
  800916:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  800919:	39 c2                	cmp    %eax,%edx
  80091b:	76 2b                	jbe    800948 <memmove+0x48>
		s += n;
		d += n;
  80091d:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800920:	89 fe                	mov    %edi,%esi
  800922:	09 ce                	or     %ecx,%esi
  800924:	09 d6                	or     %edx,%esi
  800926:	f7 c6 03 00 00 00    	test   $0x3,%esi
  80092c:	75 0e                	jne    80093c <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  80092e:	83 ef 04             	sub    $0x4,%edi
  800931:	8d 72 fc             	lea    -0x4(%edx),%esi
  800934:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  800937:	fd                   	std    
  800938:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80093a:	eb 09                	jmp    800945 <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  80093c:	83 ef 01             	sub    $0x1,%edi
  80093f:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  800942:	fd                   	std    
  800943:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  800945:	fc                   	cld    
  800946:	eb 1a                	jmp    800962 <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800948:	89 c2                	mov    %eax,%edx
  80094a:	09 ca                	or     %ecx,%edx
  80094c:	09 f2                	or     %esi,%edx
  80094e:	f6 c2 03             	test   $0x3,%dl
  800951:	75 0a                	jne    80095d <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800953:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800956:	89 c7                	mov    %eax,%edi
  800958:	fc                   	cld    
  800959:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  80095b:	eb 05                	jmp    800962 <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  80095d:	89 c7                	mov    %eax,%edi
  80095f:	fc                   	cld    
  800960:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800962:	5e                   	pop    %esi
  800963:	5f                   	pop    %edi
  800964:	5d                   	pop    %ebp
  800965:	c3                   	ret    

00800966 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800966:	f3 0f 1e fb          	endbr32 
  80096a:	55                   	push   %ebp
  80096b:	89 e5                	mov    %esp,%ebp
  80096d:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800970:	ff 75 10             	pushl  0x10(%ebp)
  800973:	ff 75 0c             	pushl  0xc(%ebp)
  800976:	ff 75 08             	pushl  0x8(%ebp)
  800979:	e8 82 ff ff ff       	call   800900 <memmove>
}
  80097e:	c9                   	leave  
  80097f:	c3                   	ret    

00800980 <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800980:	f3 0f 1e fb          	endbr32 
  800984:	55                   	push   %ebp
  800985:	89 e5                	mov    %esp,%ebp
  800987:	56                   	push   %esi
  800988:	53                   	push   %ebx
  800989:	8b 45 08             	mov    0x8(%ebp),%eax
  80098c:	8b 55 0c             	mov    0xc(%ebp),%edx
  80098f:	89 c6                	mov    %eax,%esi
  800991:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800994:	39 f0                	cmp    %esi,%eax
  800996:	74 1c                	je     8009b4 <memcmp+0x34>
		if (*s1 != *s2)
  800998:	0f b6 08             	movzbl (%eax),%ecx
  80099b:	0f b6 1a             	movzbl (%edx),%ebx
  80099e:	38 d9                	cmp    %bl,%cl
  8009a0:	75 08                	jne    8009aa <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  8009a2:	83 c0 01             	add    $0x1,%eax
  8009a5:	83 c2 01             	add    $0x1,%edx
  8009a8:	eb ea                	jmp    800994 <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  8009aa:	0f b6 c1             	movzbl %cl,%eax
  8009ad:	0f b6 db             	movzbl %bl,%ebx
  8009b0:	29 d8                	sub    %ebx,%eax
  8009b2:	eb 05                	jmp    8009b9 <memcmp+0x39>
	}

	return 0;
  8009b4:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8009b9:	5b                   	pop    %ebx
  8009ba:	5e                   	pop    %esi
  8009bb:	5d                   	pop    %ebp
  8009bc:	c3                   	ret    

008009bd <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  8009bd:	f3 0f 1e fb          	endbr32 
  8009c1:	55                   	push   %ebp
  8009c2:	89 e5                	mov    %esp,%ebp
  8009c4:	8b 45 08             	mov    0x8(%ebp),%eax
  8009c7:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  8009ca:	89 c2                	mov    %eax,%edx
  8009cc:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  8009cf:	39 d0                	cmp    %edx,%eax
  8009d1:	73 09                	jae    8009dc <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  8009d3:	38 08                	cmp    %cl,(%eax)
  8009d5:	74 05                	je     8009dc <memfind+0x1f>
	for (; s < ends; s++)
  8009d7:	83 c0 01             	add    $0x1,%eax
  8009da:	eb f3                	jmp    8009cf <memfind+0x12>
			break;
	return (void *) s;
}
  8009dc:	5d                   	pop    %ebp
  8009dd:	c3                   	ret    

008009de <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  8009de:	f3 0f 1e fb          	endbr32 
  8009e2:	55                   	push   %ebp
  8009e3:	89 e5                	mov    %esp,%ebp
  8009e5:	57                   	push   %edi
  8009e6:	56                   	push   %esi
  8009e7:	53                   	push   %ebx
  8009e8:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8009eb:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  8009ee:	eb 03                	jmp    8009f3 <strtol+0x15>
		s++;
  8009f0:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  8009f3:	0f b6 01             	movzbl (%ecx),%eax
  8009f6:	3c 20                	cmp    $0x20,%al
  8009f8:	74 f6                	je     8009f0 <strtol+0x12>
  8009fa:	3c 09                	cmp    $0x9,%al
  8009fc:	74 f2                	je     8009f0 <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  8009fe:	3c 2b                	cmp    $0x2b,%al
  800a00:	74 2a                	je     800a2c <strtol+0x4e>
	int neg = 0;
  800a02:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800a07:	3c 2d                	cmp    $0x2d,%al
  800a09:	74 2b                	je     800a36 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a0b:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800a11:	75 0f                	jne    800a22 <strtol+0x44>
  800a13:	80 39 30             	cmpb   $0x30,(%ecx)
  800a16:	74 28                	je     800a40 <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800a18:	85 db                	test   %ebx,%ebx
  800a1a:	b8 0a 00 00 00       	mov    $0xa,%eax
  800a1f:	0f 44 d8             	cmove  %eax,%ebx
  800a22:	b8 00 00 00 00       	mov    $0x0,%eax
  800a27:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800a2a:	eb 46                	jmp    800a72 <strtol+0x94>
		s++;
  800a2c:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800a2f:	bf 00 00 00 00       	mov    $0x0,%edi
  800a34:	eb d5                	jmp    800a0b <strtol+0x2d>
		s++, neg = 1;
  800a36:	83 c1 01             	add    $0x1,%ecx
  800a39:	bf 01 00 00 00       	mov    $0x1,%edi
  800a3e:	eb cb                	jmp    800a0b <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800a40:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800a44:	74 0e                	je     800a54 <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800a46:	85 db                	test   %ebx,%ebx
  800a48:	75 d8                	jne    800a22 <strtol+0x44>
		s++, base = 8;
  800a4a:	83 c1 01             	add    $0x1,%ecx
  800a4d:	bb 08 00 00 00       	mov    $0x8,%ebx
  800a52:	eb ce                	jmp    800a22 <strtol+0x44>
		s += 2, base = 16;
  800a54:	83 c1 02             	add    $0x2,%ecx
  800a57:	bb 10 00 00 00       	mov    $0x10,%ebx
  800a5c:	eb c4                	jmp    800a22 <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800a5e:	0f be d2             	movsbl %dl,%edx
  800a61:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800a64:	3b 55 10             	cmp    0x10(%ebp),%edx
  800a67:	7d 3a                	jge    800aa3 <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800a69:	83 c1 01             	add    $0x1,%ecx
  800a6c:	0f af 45 10          	imul   0x10(%ebp),%eax
  800a70:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800a72:	0f b6 11             	movzbl (%ecx),%edx
  800a75:	8d 72 d0             	lea    -0x30(%edx),%esi
  800a78:	89 f3                	mov    %esi,%ebx
  800a7a:	80 fb 09             	cmp    $0x9,%bl
  800a7d:	76 df                	jbe    800a5e <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800a7f:	8d 72 9f             	lea    -0x61(%edx),%esi
  800a82:	89 f3                	mov    %esi,%ebx
  800a84:	80 fb 19             	cmp    $0x19,%bl
  800a87:	77 08                	ja     800a91 <strtol+0xb3>
			dig = *s - 'a' + 10;
  800a89:	0f be d2             	movsbl %dl,%edx
  800a8c:	83 ea 57             	sub    $0x57,%edx
  800a8f:	eb d3                	jmp    800a64 <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800a91:	8d 72 bf             	lea    -0x41(%edx),%esi
  800a94:	89 f3                	mov    %esi,%ebx
  800a96:	80 fb 19             	cmp    $0x19,%bl
  800a99:	77 08                	ja     800aa3 <strtol+0xc5>
			dig = *s - 'A' + 10;
  800a9b:	0f be d2             	movsbl %dl,%edx
  800a9e:	83 ea 37             	sub    $0x37,%edx
  800aa1:	eb c1                	jmp    800a64 <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800aa3:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800aa7:	74 05                	je     800aae <strtol+0xd0>
		*endptr = (char *) s;
  800aa9:	8b 75 0c             	mov    0xc(%ebp),%esi
  800aac:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800aae:	89 c2                	mov    %eax,%edx
  800ab0:	f7 da                	neg    %edx
  800ab2:	85 ff                	test   %edi,%edi
  800ab4:	0f 45 c2             	cmovne %edx,%eax
}
  800ab7:	5b                   	pop    %ebx
  800ab8:	5e                   	pop    %esi
  800ab9:	5f                   	pop    %edi
  800aba:	5d                   	pop    %ebp
  800abb:	c3                   	ret    

00800abc <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800abc:	f3 0f 1e fb          	endbr32 
  800ac0:	55                   	push   %ebp
  800ac1:	89 e5                	mov    %esp,%ebp
  800ac3:	57                   	push   %edi
  800ac4:	56                   	push   %esi
  800ac5:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ac6:	b8 00 00 00 00       	mov    $0x0,%eax
  800acb:	8b 55 08             	mov    0x8(%ebp),%edx
  800ace:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ad1:	89 c3                	mov    %eax,%ebx
  800ad3:	89 c7                	mov    %eax,%edi
  800ad5:	89 c6                	mov    %eax,%esi
  800ad7:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800ad9:	5b                   	pop    %ebx
  800ada:	5e                   	pop    %esi
  800adb:	5f                   	pop    %edi
  800adc:	5d                   	pop    %ebp
  800add:	c3                   	ret    

00800ade <sys_cgetc>:

int
sys_cgetc(void)
{
  800ade:	f3 0f 1e fb          	endbr32 
  800ae2:	55                   	push   %ebp
  800ae3:	89 e5                	mov    %esp,%ebp
  800ae5:	57                   	push   %edi
  800ae6:	56                   	push   %esi
  800ae7:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ae8:	ba 00 00 00 00       	mov    $0x0,%edx
  800aed:	b8 01 00 00 00       	mov    $0x1,%eax
  800af2:	89 d1                	mov    %edx,%ecx
  800af4:	89 d3                	mov    %edx,%ebx
  800af6:	89 d7                	mov    %edx,%edi
  800af8:	89 d6                	mov    %edx,%esi
  800afa:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800afc:	5b                   	pop    %ebx
  800afd:	5e                   	pop    %esi
  800afe:	5f                   	pop    %edi
  800aff:	5d                   	pop    %ebp
  800b00:	c3                   	ret    

00800b01 <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800b01:	f3 0f 1e fb          	endbr32 
  800b05:	55                   	push   %ebp
  800b06:	89 e5                	mov    %esp,%ebp
  800b08:	57                   	push   %edi
  800b09:	56                   	push   %esi
  800b0a:	53                   	push   %ebx
  800b0b:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800b0e:	b9 00 00 00 00       	mov    $0x0,%ecx
  800b13:	8b 55 08             	mov    0x8(%ebp),%edx
  800b16:	b8 03 00 00 00       	mov    $0x3,%eax
  800b1b:	89 cb                	mov    %ecx,%ebx
  800b1d:	89 cf                	mov    %ecx,%edi
  800b1f:	89 ce                	mov    %ecx,%esi
  800b21:	cd 30                	int    $0x30
	if(check && ret > 0)
  800b23:	85 c0                	test   %eax,%eax
  800b25:	7f 08                	jg     800b2f <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800b27:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800b2a:	5b                   	pop    %ebx
  800b2b:	5e                   	pop    %esi
  800b2c:	5f                   	pop    %edi
  800b2d:	5d                   	pop    %ebp
  800b2e:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800b2f:	83 ec 0c             	sub    $0xc,%esp
  800b32:	50                   	push   %eax
  800b33:	6a 03                	push   $0x3
  800b35:	68 3f 22 80 00       	push   $0x80223f
  800b3a:	6a 23                	push   $0x23
  800b3c:	68 5c 22 80 00       	push   $0x80225c
  800b41:	e8 9c 0f 00 00       	call   801ae2 <_panic>

00800b46 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800b46:	f3 0f 1e fb          	endbr32 
  800b4a:	55                   	push   %ebp
  800b4b:	89 e5                	mov    %esp,%ebp
  800b4d:	57                   	push   %edi
  800b4e:	56                   	push   %esi
  800b4f:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b50:	ba 00 00 00 00       	mov    $0x0,%edx
  800b55:	b8 02 00 00 00       	mov    $0x2,%eax
  800b5a:	89 d1                	mov    %edx,%ecx
  800b5c:	89 d3                	mov    %edx,%ebx
  800b5e:	89 d7                	mov    %edx,%edi
  800b60:	89 d6                	mov    %edx,%esi
  800b62:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800b64:	5b                   	pop    %ebx
  800b65:	5e                   	pop    %esi
  800b66:	5f                   	pop    %edi
  800b67:	5d                   	pop    %ebp
  800b68:	c3                   	ret    

00800b69 <sys_yield>:

void
sys_yield(void)
{
  800b69:	f3 0f 1e fb          	endbr32 
  800b6d:	55                   	push   %ebp
  800b6e:	89 e5                	mov    %esp,%ebp
  800b70:	57                   	push   %edi
  800b71:	56                   	push   %esi
  800b72:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b73:	ba 00 00 00 00       	mov    $0x0,%edx
  800b78:	b8 0b 00 00 00       	mov    $0xb,%eax
  800b7d:	89 d1                	mov    %edx,%ecx
  800b7f:	89 d3                	mov    %edx,%ebx
  800b81:	89 d7                	mov    %edx,%edi
  800b83:	89 d6                	mov    %edx,%esi
  800b85:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800b87:	5b                   	pop    %ebx
  800b88:	5e                   	pop    %esi
  800b89:	5f                   	pop    %edi
  800b8a:	5d                   	pop    %ebp
  800b8b:	c3                   	ret    

00800b8c <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800b8c:	f3 0f 1e fb          	endbr32 
  800b90:	55                   	push   %ebp
  800b91:	89 e5                	mov    %esp,%ebp
  800b93:	57                   	push   %edi
  800b94:	56                   	push   %esi
  800b95:	53                   	push   %ebx
  800b96:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800b99:	be 00 00 00 00       	mov    $0x0,%esi
  800b9e:	8b 55 08             	mov    0x8(%ebp),%edx
  800ba1:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ba4:	b8 04 00 00 00       	mov    $0x4,%eax
  800ba9:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800bac:	89 f7                	mov    %esi,%edi
  800bae:	cd 30                	int    $0x30
	if(check && ret > 0)
  800bb0:	85 c0                	test   %eax,%eax
  800bb2:	7f 08                	jg     800bbc <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800bb4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bb7:	5b                   	pop    %ebx
  800bb8:	5e                   	pop    %esi
  800bb9:	5f                   	pop    %edi
  800bba:	5d                   	pop    %ebp
  800bbb:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800bbc:	83 ec 0c             	sub    $0xc,%esp
  800bbf:	50                   	push   %eax
  800bc0:	6a 04                	push   $0x4
  800bc2:	68 3f 22 80 00       	push   $0x80223f
  800bc7:	6a 23                	push   $0x23
  800bc9:	68 5c 22 80 00       	push   $0x80225c
  800bce:	e8 0f 0f 00 00       	call   801ae2 <_panic>

00800bd3 <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800bd3:	f3 0f 1e fb          	endbr32 
  800bd7:	55                   	push   %ebp
  800bd8:	89 e5                	mov    %esp,%ebp
  800bda:	57                   	push   %edi
  800bdb:	56                   	push   %esi
  800bdc:	53                   	push   %ebx
  800bdd:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800be0:	8b 55 08             	mov    0x8(%ebp),%edx
  800be3:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800be6:	b8 05 00 00 00       	mov    $0x5,%eax
  800beb:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800bee:	8b 7d 14             	mov    0x14(%ebp),%edi
  800bf1:	8b 75 18             	mov    0x18(%ebp),%esi
  800bf4:	cd 30                	int    $0x30
	if(check && ret > 0)
  800bf6:	85 c0                	test   %eax,%eax
  800bf8:	7f 08                	jg     800c02 <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800bfa:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800bfd:	5b                   	pop    %ebx
  800bfe:	5e                   	pop    %esi
  800bff:	5f                   	pop    %edi
  800c00:	5d                   	pop    %ebp
  800c01:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c02:	83 ec 0c             	sub    $0xc,%esp
  800c05:	50                   	push   %eax
  800c06:	6a 05                	push   $0x5
  800c08:	68 3f 22 80 00       	push   $0x80223f
  800c0d:	6a 23                	push   $0x23
  800c0f:	68 5c 22 80 00       	push   $0x80225c
  800c14:	e8 c9 0e 00 00       	call   801ae2 <_panic>

00800c19 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800c19:	f3 0f 1e fb          	endbr32 
  800c1d:	55                   	push   %ebp
  800c1e:	89 e5                	mov    %esp,%ebp
  800c20:	57                   	push   %edi
  800c21:	56                   	push   %esi
  800c22:	53                   	push   %ebx
  800c23:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c26:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c2b:	8b 55 08             	mov    0x8(%ebp),%edx
  800c2e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c31:	b8 06 00 00 00       	mov    $0x6,%eax
  800c36:	89 df                	mov    %ebx,%edi
  800c38:	89 de                	mov    %ebx,%esi
  800c3a:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c3c:	85 c0                	test   %eax,%eax
  800c3e:	7f 08                	jg     800c48 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800c40:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c43:	5b                   	pop    %ebx
  800c44:	5e                   	pop    %esi
  800c45:	5f                   	pop    %edi
  800c46:	5d                   	pop    %ebp
  800c47:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c48:	83 ec 0c             	sub    $0xc,%esp
  800c4b:	50                   	push   %eax
  800c4c:	6a 06                	push   $0x6
  800c4e:	68 3f 22 80 00       	push   $0x80223f
  800c53:	6a 23                	push   $0x23
  800c55:	68 5c 22 80 00       	push   $0x80225c
  800c5a:	e8 83 0e 00 00       	call   801ae2 <_panic>

00800c5f <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800c5f:	f3 0f 1e fb          	endbr32 
  800c63:	55                   	push   %ebp
  800c64:	89 e5                	mov    %esp,%ebp
  800c66:	57                   	push   %edi
  800c67:	56                   	push   %esi
  800c68:	53                   	push   %ebx
  800c69:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c6c:	bb 00 00 00 00       	mov    $0x0,%ebx
  800c71:	8b 55 08             	mov    0x8(%ebp),%edx
  800c74:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c77:	b8 08 00 00 00       	mov    $0x8,%eax
  800c7c:	89 df                	mov    %ebx,%edi
  800c7e:	89 de                	mov    %ebx,%esi
  800c80:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c82:	85 c0                	test   %eax,%eax
  800c84:	7f 08                	jg     800c8e <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800c86:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c89:	5b                   	pop    %ebx
  800c8a:	5e                   	pop    %esi
  800c8b:	5f                   	pop    %edi
  800c8c:	5d                   	pop    %ebp
  800c8d:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c8e:	83 ec 0c             	sub    $0xc,%esp
  800c91:	50                   	push   %eax
  800c92:	6a 08                	push   $0x8
  800c94:	68 3f 22 80 00       	push   $0x80223f
  800c99:	6a 23                	push   $0x23
  800c9b:	68 5c 22 80 00       	push   $0x80225c
  800ca0:	e8 3d 0e 00 00       	call   801ae2 <_panic>

00800ca5 <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800ca5:	f3 0f 1e fb          	endbr32 
  800ca9:	55                   	push   %ebp
  800caa:	89 e5                	mov    %esp,%ebp
  800cac:	57                   	push   %edi
  800cad:	56                   	push   %esi
  800cae:	53                   	push   %ebx
  800caf:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cb2:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cb7:	8b 55 08             	mov    0x8(%ebp),%edx
  800cba:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800cbd:	b8 09 00 00 00       	mov    $0x9,%eax
  800cc2:	89 df                	mov    %ebx,%edi
  800cc4:	89 de                	mov    %ebx,%esi
  800cc6:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cc8:	85 c0                	test   %eax,%eax
  800cca:	7f 08                	jg     800cd4 <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800ccc:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800ccf:	5b                   	pop    %ebx
  800cd0:	5e                   	pop    %esi
  800cd1:	5f                   	pop    %edi
  800cd2:	5d                   	pop    %ebp
  800cd3:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cd4:	83 ec 0c             	sub    $0xc,%esp
  800cd7:	50                   	push   %eax
  800cd8:	6a 09                	push   $0x9
  800cda:	68 3f 22 80 00       	push   $0x80223f
  800cdf:	6a 23                	push   $0x23
  800ce1:	68 5c 22 80 00       	push   $0x80225c
  800ce6:	e8 f7 0d 00 00       	call   801ae2 <_panic>

00800ceb <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800ceb:	f3 0f 1e fb          	endbr32 
  800cef:	55                   	push   %ebp
  800cf0:	89 e5                	mov    %esp,%ebp
  800cf2:	57                   	push   %edi
  800cf3:	56                   	push   %esi
  800cf4:	53                   	push   %ebx
  800cf5:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800cf8:	bb 00 00 00 00       	mov    $0x0,%ebx
  800cfd:	8b 55 08             	mov    0x8(%ebp),%edx
  800d00:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d03:	b8 0a 00 00 00       	mov    $0xa,%eax
  800d08:	89 df                	mov    %ebx,%edi
  800d0a:	89 de                	mov    %ebx,%esi
  800d0c:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d0e:	85 c0                	test   %eax,%eax
  800d10:	7f 08                	jg     800d1a <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800d12:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d15:	5b                   	pop    %ebx
  800d16:	5e                   	pop    %esi
  800d17:	5f                   	pop    %edi
  800d18:	5d                   	pop    %ebp
  800d19:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d1a:	83 ec 0c             	sub    $0xc,%esp
  800d1d:	50                   	push   %eax
  800d1e:	6a 0a                	push   $0xa
  800d20:	68 3f 22 80 00       	push   $0x80223f
  800d25:	6a 23                	push   $0x23
  800d27:	68 5c 22 80 00       	push   $0x80225c
  800d2c:	e8 b1 0d 00 00       	call   801ae2 <_panic>

00800d31 <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800d31:	f3 0f 1e fb          	endbr32 
  800d35:	55                   	push   %ebp
  800d36:	89 e5                	mov    %esp,%ebp
  800d38:	57                   	push   %edi
  800d39:	56                   	push   %esi
  800d3a:	53                   	push   %ebx
	asm volatile("int %1\n"
  800d3b:	8b 55 08             	mov    0x8(%ebp),%edx
  800d3e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d41:	b8 0c 00 00 00       	mov    $0xc,%eax
  800d46:	be 00 00 00 00       	mov    $0x0,%esi
  800d4b:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800d4e:	8b 7d 14             	mov    0x14(%ebp),%edi
  800d51:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800d53:	5b                   	pop    %ebx
  800d54:	5e                   	pop    %esi
  800d55:	5f                   	pop    %edi
  800d56:	5d                   	pop    %ebp
  800d57:	c3                   	ret    

00800d58 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800d58:	f3 0f 1e fb          	endbr32 
  800d5c:	55                   	push   %ebp
  800d5d:	89 e5                	mov    %esp,%ebp
  800d5f:	57                   	push   %edi
  800d60:	56                   	push   %esi
  800d61:	53                   	push   %ebx
  800d62:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d65:	b9 00 00 00 00       	mov    $0x0,%ecx
  800d6a:	8b 55 08             	mov    0x8(%ebp),%edx
  800d6d:	b8 0d 00 00 00       	mov    $0xd,%eax
  800d72:	89 cb                	mov    %ecx,%ebx
  800d74:	89 cf                	mov    %ecx,%edi
  800d76:	89 ce                	mov    %ecx,%esi
  800d78:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d7a:	85 c0                	test   %eax,%eax
  800d7c:	7f 08                	jg     800d86 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800d7e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d81:	5b                   	pop    %ebx
  800d82:	5e                   	pop    %esi
  800d83:	5f                   	pop    %edi
  800d84:	5d                   	pop    %ebp
  800d85:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d86:	83 ec 0c             	sub    $0xc,%esp
  800d89:	50                   	push   %eax
  800d8a:	6a 0d                	push   $0xd
  800d8c:	68 3f 22 80 00       	push   $0x80223f
  800d91:	6a 23                	push   $0x23
  800d93:	68 5c 22 80 00       	push   $0x80225c
  800d98:	e8 45 0d 00 00       	call   801ae2 <_panic>

00800d9d <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800d9d:	f3 0f 1e fb          	endbr32 
  800da1:	55                   	push   %ebp
  800da2:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800da4:	8b 45 08             	mov    0x8(%ebp),%eax
  800da7:	05 00 00 00 30       	add    $0x30000000,%eax
  800dac:	c1 e8 0c             	shr    $0xc,%eax
}
  800daf:	5d                   	pop    %ebp
  800db0:	c3                   	ret    

00800db1 <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800db1:	f3 0f 1e fb          	endbr32 
  800db5:	55                   	push   %ebp
  800db6:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800db8:	8b 45 08             	mov    0x8(%ebp),%eax
  800dbb:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800dc0:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800dc5:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800dca:	5d                   	pop    %ebp
  800dcb:	c3                   	ret    

00800dcc <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800dcc:	f3 0f 1e fb          	endbr32 
  800dd0:	55                   	push   %ebp
  800dd1:	89 e5                	mov    %esp,%ebp
  800dd3:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800dd8:	89 c2                	mov    %eax,%edx
  800dda:	c1 ea 16             	shr    $0x16,%edx
  800ddd:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800de4:	f6 c2 01             	test   $0x1,%dl
  800de7:	74 2d                	je     800e16 <fd_alloc+0x4a>
  800de9:	89 c2                	mov    %eax,%edx
  800deb:	c1 ea 0c             	shr    $0xc,%edx
  800dee:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800df5:	f6 c2 01             	test   $0x1,%dl
  800df8:	74 1c                	je     800e16 <fd_alloc+0x4a>
  800dfa:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800dff:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800e04:	75 d2                	jne    800dd8 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800e06:	8b 45 08             	mov    0x8(%ebp),%eax
  800e09:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800e0f:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800e14:	eb 0a                	jmp    800e20 <fd_alloc+0x54>
			*fd_store = fd;
  800e16:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e19:	89 01                	mov    %eax,(%ecx)
			return 0;
  800e1b:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e20:	5d                   	pop    %ebp
  800e21:	c3                   	ret    

00800e22 <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800e22:	f3 0f 1e fb          	endbr32 
  800e26:	55                   	push   %ebp
  800e27:	89 e5                	mov    %esp,%ebp
  800e29:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800e2c:	83 f8 1f             	cmp    $0x1f,%eax
  800e2f:	77 30                	ja     800e61 <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800e31:	c1 e0 0c             	shl    $0xc,%eax
  800e34:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800e39:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800e3f:	f6 c2 01             	test   $0x1,%dl
  800e42:	74 24                	je     800e68 <fd_lookup+0x46>
  800e44:	89 c2                	mov    %eax,%edx
  800e46:	c1 ea 0c             	shr    $0xc,%edx
  800e49:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800e50:	f6 c2 01             	test   $0x1,%dl
  800e53:	74 1a                	je     800e6f <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800e55:	8b 55 0c             	mov    0xc(%ebp),%edx
  800e58:	89 02                	mov    %eax,(%edx)
	return 0;
  800e5a:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800e5f:	5d                   	pop    %ebp
  800e60:	c3                   	ret    
		return -E_INVAL;
  800e61:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e66:	eb f7                	jmp    800e5f <fd_lookup+0x3d>
		return -E_INVAL;
  800e68:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e6d:	eb f0                	jmp    800e5f <fd_lookup+0x3d>
  800e6f:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800e74:	eb e9                	jmp    800e5f <fd_lookup+0x3d>

00800e76 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800e76:	f3 0f 1e fb          	endbr32 
  800e7a:	55                   	push   %ebp
  800e7b:	89 e5                	mov    %esp,%ebp
  800e7d:	83 ec 08             	sub    $0x8,%esp
  800e80:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800e83:	ba e8 22 80 00       	mov    $0x8022e8,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800e88:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800e8d:	39 08                	cmp    %ecx,(%eax)
  800e8f:	74 33                	je     800ec4 <dev_lookup+0x4e>
  800e91:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800e94:	8b 02                	mov    (%edx),%eax
  800e96:	85 c0                	test   %eax,%eax
  800e98:	75 f3                	jne    800e8d <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800e9a:	a1 04 40 80 00       	mov    0x804004,%eax
  800e9f:	8b 40 48             	mov    0x48(%eax),%eax
  800ea2:	83 ec 04             	sub    $0x4,%esp
  800ea5:	51                   	push   %ecx
  800ea6:	50                   	push   %eax
  800ea7:	68 6c 22 80 00       	push   $0x80226c
  800eac:	e8 c0 f2 ff ff       	call   800171 <cprintf>
	*dev = 0;
  800eb1:	8b 45 0c             	mov    0xc(%ebp),%eax
  800eb4:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  800eba:	83 c4 10             	add    $0x10,%esp
  800ebd:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  800ec2:	c9                   	leave  
  800ec3:	c3                   	ret    
			*dev = devtab[i];
  800ec4:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ec7:	89 01                	mov    %eax,(%ecx)
			return 0;
  800ec9:	b8 00 00 00 00       	mov    $0x0,%eax
  800ece:	eb f2                	jmp    800ec2 <dev_lookup+0x4c>

00800ed0 <fd_close>:
{
  800ed0:	f3 0f 1e fb          	endbr32 
  800ed4:	55                   	push   %ebp
  800ed5:	89 e5                	mov    %esp,%ebp
  800ed7:	57                   	push   %edi
  800ed8:	56                   	push   %esi
  800ed9:	53                   	push   %ebx
  800eda:	83 ec 24             	sub    $0x24,%esp
  800edd:	8b 75 08             	mov    0x8(%ebp),%esi
  800ee0:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800ee3:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800ee6:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800ee7:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  800eed:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  800ef0:	50                   	push   %eax
  800ef1:	e8 2c ff ff ff       	call   800e22 <fd_lookup>
  800ef6:	89 c3                	mov    %eax,%ebx
  800ef8:	83 c4 10             	add    $0x10,%esp
  800efb:	85 c0                	test   %eax,%eax
  800efd:	78 05                	js     800f04 <fd_close+0x34>
	    || fd != fd2)
  800eff:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  800f02:	74 16                	je     800f1a <fd_close+0x4a>
		return (must_exist ? r : 0);
  800f04:	89 f8                	mov    %edi,%eax
  800f06:	84 c0                	test   %al,%al
  800f08:	b8 00 00 00 00       	mov    $0x0,%eax
  800f0d:	0f 44 d8             	cmove  %eax,%ebx
}
  800f10:	89 d8                	mov    %ebx,%eax
  800f12:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800f15:	5b                   	pop    %ebx
  800f16:	5e                   	pop    %esi
  800f17:	5f                   	pop    %edi
  800f18:	5d                   	pop    %ebp
  800f19:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  800f1a:	83 ec 08             	sub    $0x8,%esp
  800f1d:	8d 45 e0             	lea    -0x20(%ebp),%eax
  800f20:	50                   	push   %eax
  800f21:	ff 36                	pushl  (%esi)
  800f23:	e8 4e ff ff ff       	call   800e76 <dev_lookup>
  800f28:	89 c3                	mov    %eax,%ebx
  800f2a:	83 c4 10             	add    $0x10,%esp
  800f2d:	85 c0                	test   %eax,%eax
  800f2f:	78 1a                	js     800f4b <fd_close+0x7b>
		if (dev->dev_close)
  800f31:	8b 45 e0             	mov    -0x20(%ebp),%eax
  800f34:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  800f37:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  800f3c:	85 c0                	test   %eax,%eax
  800f3e:	74 0b                	je     800f4b <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  800f40:	83 ec 0c             	sub    $0xc,%esp
  800f43:	56                   	push   %esi
  800f44:	ff d0                	call   *%eax
  800f46:	89 c3                	mov    %eax,%ebx
  800f48:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  800f4b:	83 ec 08             	sub    $0x8,%esp
  800f4e:	56                   	push   %esi
  800f4f:	6a 00                	push   $0x0
  800f51:	e8 c3 fc ff ff       	call   800c19 <sys_page_unmap>
	return r;
  800f56:	83 c4 10             	add    $0x10,%esp
  800f59:	eb b5                	jmp    800f10 <fd_close+0x40>

00800f5b <close>:

int
close(int fdnum)
{
  800f5b:	f3 0f 1e fb          	endbr32 
  800f5f:	55                   	push   %ebp
  800f60:	89 e5                	mov    %esp,%ebp
  800f62:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  800f65:	8d 45 f4             	lea    -0xc(%ebp),%eax
  800f68:	50                   	push   %eax
  800f69:	ff 75 08             	pushl  0x8(%ebp)
  800f6c:	e8 b1 fe ff ff       	call   800e22 <fd_lookup>
  800f71:	83 c4 10             	add    $0x10,%esp
  800f74:	85 c0                	test   %eax,%eax
  800f76:	79 02                	jns    800f7a <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  800f78:	c9                   	leave  
  800f79:	c3                   	ret    
		return fd_close(fd, 1);
  800f7a:	83 ec 08             	sub    $0x8,%esp
  800f7d:	6a 01                	push   $0x1
  800f7f:	ff 75 f4             	pushl  -0xc(%ebp)
  800f82:	e8 49 ff ff ff       	call   800ed0 <fd_close>
  800f87:	83 c4 10             	add    $0x10,%esp
  800f8a:	eb ec                	jmp    800f78 <close+0x1d>

00800f8c <close_all>:

void
close_all(void)
{
  800f8c:	f3 0f 1e fb          	endbr32 
  800f90:	55                   	push   %ebp
  800f91:	89 e5                	mov    %esp,%ebp
  800f93:	53                   	push   %ebx
  800f94:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  800f97:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  800f9c:	83 ec 0c             	sub    $0xc,%esp
  800f9f:	53                   	push   %ebx
  800fa0:	e8 b6 ff ff ff       	call   800f5b <close>
	for (i = 0; i < MAXFD; i++)
  800fa5:	83 c3 01             	add    $0x1,%ebx
  800fa8:	83 c4 10             	add    $0x10,%esp
  800fab:	83 fb 20             	cmp    $0x20,%ebx
  800fae:	75 ec                	jne    800f9c <close_all+0x10>
}
  800fb0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800fb3:	c9                   	leave  
  800fb4:	c3                   	ret    

00800fb5 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  800fb5:	f3 0f 1e fb          	endbr32 
  800fb9:	55                   	push   %ebp
  800fba:	89 e5                	mov    %esp,%ebp
  800fbc:	57                   	push   %edi
  800fbd:	56                   	push   %esi
  800fbe:	53                   	push   %ebx
  800fbf:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  800fc2:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  800fc5:	50                   	push   %eax
  800fc6:	ff 75 08             	pushl  0x8(%ebp)
  800fc9:	e8 54 fe ff ff       	call   800e22 <fd_lookup>
  800fce:	89 c3                	mov    %eax,%ebx
  800fd0:	83 c4 10             	add    $0x10,%esp
  800fd3:	85 c0                	test   %eax,%eax
  800fd5:	0f 88 81 00 00 00    	js     80105c <dup+0xa7>
		return r;
	close(newfdnum);
  800fdb:	83 ec 0c             	sub    $0xc,%esp
  800fde:	ff 75 0c             	pushl  0xc(%ebp)
  800fe1:	e8 75 ff ff ff       	call   800f5b <close>

	newfd = INDEX2FD(newfdnum);
  800fe6:	8b 75 0c             	mov    0xc(%ebp),%esi
  800fe9:	c1 e6 0c             	shl    $0xc,%esi
  800fec:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  800ff2:	83 c4 04             	add    $0x4,%esp
  800ff5:	ff 75 e4             	pushl  -0x1c(%ebp)
  800ff8:	e8 b4 fd ff ff       	call   800db1 <fd2data>
  800ffd:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  800fff:	89 34 24             	mov    %esi,(%esp)
  801002:	e8 aa fd ff ff       	call   800db1 <fd2data>
  801007:	83 c4 10             	add    $0x10,%esp
  80100a:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  80100c:	89 d8                	mov    %ebx,%eax
  80100e:	c1 e8 16             	shr    $0x16,%eax
  801011:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801018:	a8 01                	test   $0x1,%al
  80101a:	74 11                	je     80102d <dup+0x78>
  80101c:	89 d8                	mov    %ebx,%eax
  80101e:	c1 e8 0c             	shr    $0xc,%eax
  801021:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801028:	f6 c2 01             	test   $0x1,%dl
  80102b:	75 39                	jne    801066 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  80102d:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  801030:	89 d0                	mov    %edx,%eax
  801032:	c1 e8 0c             	shr    $0xc,%eax
  801035:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80103c:	83 ec 0c             	sub    $0xc,%esp
  80103f:	25 07 0e 00 00       	and    $0xe07,%eax
  801044:	50                   	push   %eax
  801045:	56                   	push   %esi
  801046:	6a 00                	push   $0x0
  801048:	52                   	push   %edx
  801049:	6a 00                	push   $0x0
  80104b:	e8 83 fb ff ff       	call   800bd3 <sys_page_map>
  801050:	89 c3                	mov    %eax,%ebx
  801052:	83 c4 20             	add    $0x20,%esp
  801055:	85 c0                	test   %eax,%eax
  801057:	78 31                	js     80108a <dup+0xd5>
		goto err;

	return newfdnum;
  801059:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  80105c:	89 d8                	mov    %ebx,%eax
  80105e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801061:	5b                   	pop    %ebx
  801062:	5e                   	pop    %esi
  801063:	5f                   	pop    %edi
  801064:	5d                   	pop    %ebp
  801065:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  801066:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  80106d:	83 ec 0c             	sub    $0xc,%esp
  801070:	25 07 0e 00 00       	and    $0xe07,%eax
  801075:	50                   	push   %eax
  801076:	57                   	push   %edi
  801077:	6a 00                	push   $0x0
  801079:	53                   	push   %ebx
  80107a:	6a 00                	push   $0x0
  80107c:	e8 52 fb ff ff       	call   800bd3 <sys_page_map>
  801081:	89 c3                	mov    %eax,%ebx
  801083:	83 c4 20             	add    $0x20,%esp
  801086:	85 c0                	test   %eax,%eax
  801088:	79 a3                	jns    80102d <dup+0x78>
	sys_page_unmap(0, newfd);
  80108a:	83 ec 08             	sub    $0x8,%esp
  80108d:	56                   	push   %esi
  80108e:	6a 00                	push   $0x0
  801090:	e8 84 fb ff ff       	call   800c19 <sys_page_unmap>
	sys_page_unmap(0, nva);
  801095:	83 c4 08             	add    $0x8,%esp
  801098:	57                   	push   %edi
  801099:	6a 00                	push   $0x0
  80109b:	e8 79 fb ff ff       	call   800c19 <sys_page_unmap>
	return r;
  8010a0:	83 c4 10             	add    $0x10,%esp
  8010a3:	eb b7                	jmp    80105c <dup+0xa7>

008010a5 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  8010a5:	f3 0f 1e fb          	endbr32 
  8010a9:	55                   	push   %ebp
  8010aa:	89 e5                	mov    %esp,%ebp
  8010ac:	53                   	push   %ebx
  8010ad:	83 ec 1c             	sub    $0x1c,%esp
  8010b0:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8010b3:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8010b6:	50                   	push   %eax
  8010b7:	53                   	push   %ebx
  8010b8:	e8 65 fd ff ff       	call   800e22 <fd_lookup>
  8010bd:	83 c4 10             	add    $0x10,%esp
  8010c0:	85 c0                	test   %eax,%eax
  8010c2:	78 3f                	js     801103 <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8010c4:	83 ec 08             	sub    $0x8,%esp
  8010c7:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8010ca:	50                   	push   %eax
  8010cb:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8010ce:	ff 30                	pushl  (%eax)
  8010d0:	e8 a1 fd ff ff       	call   800e76 <dev_lookup>
  8010d5:	83 c4 10             	add    $0x10,%esp
  8010d8:	85 c0                	test   %eax,%eax
  8010da:	78 27                	js     801103 <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  8010dc:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8010df:	8b 42 08             	mov    0x8(%edx),%eax
  8010e2:	83 e0 03             	and    $0x3,%eax
  8010e5:	83 f8 01             	cmp    $0x1,%eax
  8010e8:	74 1e                	je     801108 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  8010ea:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8010ed:	8b 40 08             	mov    0x8(%eax),%eax
  8010f0:	85 c0                	test   %eax,%eax
  8010f2:	74 35                	je     801129 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  8010f4:	83 ec 04             	sub    $0x4,%esp
  8010f7:	ff 75 10             	pushl  0x10(%ebp)
  8010fa:	ff 75 0c             	pushl  0xc(%ebp)
  8010fd:	52                   	push   %edx
  8010fe:	ff d0                	call   *%eax
  801100:	83 c4 10             	add    $0x10,%esp
}
  801103:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801106:	c9                   	leave  
  801107:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  801108:	a1 04 40 80 00       	mov    0x804004,%eax
  80110d:	8b 40 48             	mov    0x48(%eax),%eax
  801110:	83 ec 04             	sub    $0x4,%esp
  801113:	53                   	push   %ebx
  801114:	50                   	push   %eax
  801115:	68 ad 22 80 00       	push   $0x8022ad
  80111a:	e8 52 f0 ff ff       	call   800171 <cprintf>
		return -E_INVAL;
  80111f:	83 c4 10             	add    $0x10,%esp
  801122:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801127:	eb da                	jmp    801103 <read+0x5e>
		return -E_NOT_SUPP;
  801129:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80112e:	eb d3                	jmp    801103 <read+0x5e>

00801130 <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  801130:	f3 0f 1e fb          	endbr32 
  801134:	55                   	push   %ebp
  801135:	89 e5                	mov    %esp,%ebp
  801137:	57                   	push   %edi
  801138:	56                   	push   %esi
  801139:	53                   	push   %ebx
  80113a:	83 ec 0c             	sub    $0xc,%esp
  80113d:	8b 7d 08             	mov    0x8(%ebp),%edi
  801140:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  801143:	bb 00 00 00 00       	mov    $0x0,%ebx
  801148:	eb 02                	jmp    80114c <readn+0x1c>
  80114a:	01 c3                	add    %eax,%ebx
  80114c:	39 f3                	cmp    %esi,%ebx
  80114e:	73 21                	jae    801171 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  801150:	83 ec 04             	sub    $0x4,%esp
  801153:	89 f0                	mov    %esi,%eax
  801155:	29 d8                	sub    %ebx,%eax
  801157:	50                   	push   %eax
  801158:	89 d8                	mov    %ebx,%eax
  80115a:	03 45 0c             	add    0xc(%ebp),%eax
  80115d:	50                   	push   %eax
  80115e:	57                   	push   %edi
  80115f:	e8 41 ff ff ff       	call   8010a5 <read>
		if (m < 0)
  801164:	83 c4 10             	add    $0x10,%esp
  801167:	85 c0                	test   %eax,%eax
  801169:	78 04                	js     80116f <readn+0x3f>
			return m;
		if (m == 0)
  80116b:	75 dd                	jne    80114a <readn+0x1a>
  80116d:	eb 02                	jmp    801171 <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  80116f:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  801171:	89 d8                	mov    %ebx,%eax
  801173:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801176:	5b                   	pop    %ebx
  801177:	5e                   	pop    %esi
  801178:	5f                   	pop    %edi
  801179:	5d                   	pop    %ebp
  80117a:	c3                   	ret    

0080117b <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  80117b:	f3 0f 1e fb          	endbr32 
  80117f:	55                   	push   %ebp
  801180:	89 e5                	mov    %esp,%ebp
  801182:	53                   	push   %ebx
  801183:	83 ec 1c             	sub    $0x1c,%esp
  801186:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  801189:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80118c:	50                   	push   %eax
  80118d:	53                   	push   %ebx
  80118e:	e8 8f fc ff ff       	call   800e22 <fd_lookup>
  801193:	83 c4 10             	add    $0x10,%esp
  801196:	85 c0                	test   %eax,%eax
  801198:	78 3a                	js     8011d4 <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80119a:	83 ec 08             	sub    $0x8,%esp
  80119d:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8011a0:	50                   	push   %eax
  8011a1:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011a4:	ff 30                	pushl  (%eax)
  8011a6:	e8 cb fc ff ff       	call   800e76 <dev_lookup>
  8011ab:	83 c4 10             	add    $0x10,%esp
  8011ae:	85 c0                	test   %eax,%eax
  8011b0:	78 22                	js     8011d4 <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8011b2:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8011b5:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8011b9:	74 1e                	je     8011d9 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  8011bb:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8011be:	8b 52 0c             	mov    0xc(%edx),%edx
  8011c1:	85 d2                	test   %edx,%edx
  8011c3:	74 35                	je     8011fa <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  8011c5:	83 ec 04             	sub    $0x4,%esp
  8011c8:	ff 75 10             	pushl  0x10(%ebp)
  8011cb:	ff 75 0c             	pushl  0xc(%ebp)
  8011ce:	50                   	push   %eax
  8011cf:	ff d2                	call   *%edx
  8011d1:	83 c4 10             	add    $0x10,%esp
}
  8011d4:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8011d7:	c9                   	leave  
  8011d8:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  8011d9:	a1 04 40 80 00       	mov    0x804004,%eax
  8011de:	8b 40 48             	mov    0x48(%eax),%eax
  8011e1:	83 ec 04             	sub    $0x4,%esp
  8011e4:	53                   	push   %ebx
  8011e5:	50                   	push   %eax
  8011e6:	68 c9 22 80 00       	push   $0x8022c9
  8011eb:	e8 81 ef ff ff       	call   800171 <cprintf>
		return -E_INVAL;
  8011f0:	83 c4 10             	add    $0x10,%esp
  8011f3:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8011f8:	eb da                	jmp    8011d4 <write+0x59>
		return -E_NOT_SUPP;
  8011fa:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8011ff:	eb d3                	jmp    8011d4 <write+0x59>

00801201 <seek>:

int
seek(int fdnum, off_t offset)
{
  801201:	f3 0f 1e fb          	endbr32 
  801205:	55                   	push   %ebp
  801206:	89 e5                	mov    %esp,%ebp
  801208:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  80120b:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80120e:	50                   	push   %eax
  80120f:	ff 75 08             	pushl  0x8(%ebp)
  801212:	e8 0b fc ff ff       	call   800e22 <fd_lookup>
  801217:	83 c4 10             	add    $0x10,%esp
  80121a:	85 c0                	test   %eax,%eax
  80121c:	78 0e                	js     80122c <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  80121e:	8b 55 0c             	mov    0xc(%ebp),%edx
  801221:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801224:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801227:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80122c:	c9                   	leave  
  80122d:	c3                   	ret    

0080122e <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  80122e:	f3 0f 1e fb          	endbr32 
  801232:	55                   	push   %ebp
  801233:	89 e5                	mov    %esp,%ebp
  801235:	53                   	push   %ebx
  801236:	83 ec 1c             	sub    $0x1c,%esp
  801239:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  80123c:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80123f:	50                   	push   %eax
  801240:	53                   	push   %ebx
  801241:	e8 dc fb ff ff       	call   800e22 <fd_lookup>
  801246:	83 c4 10             	add    $0x10,%esp
  801249:	85 c0                	test   %eax,%eax
  80124b:	78 37                	js     801284 <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80124d:	83 ec 08             	sub    $0x8,%esp
  801250:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801253:	50                   	push   %eax
  801254:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801257:	ff 30                	pushl  (%eax)
  801259:	e8 18 fc ff ff       	call   800e76 <dev_lookup>
  80125e:	83 c4 10             	add    $0x10,%esp
  801261:	85 c0                	test   %eax,%eax
  801263:	78 1f                	js     801284 <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  801265:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801268:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  80126c:	74 1b                	je     801289 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  80126e:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801271:	8b 52 18             	mov    0x18(%edx),%edx
  801274:	85 d2                	test   %edx,%edx
  801276:	74 32                	je     8012aa <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  801278:	83 ec 08             	sub    $0x8,%esp
  80127b:	ff 75 0c             	pushl  0xc(%ebp)
  80127e:	50                   	push   %eax
  80127f:	ff d2                	call   *%edx
  801281:	83 c4 10             	add    $0x10,%esp
}
  801284:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801287:	c9                   	leave  
  801288:	c3                   	ret    
			thisenv->env_id, fdnum);
  801289:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  80128e:	8b 40 48             	mov    0x48(%eax),%eax
  801291:	83 ec 04             	sub    $0x4,%esp
  801294:	53                   	push   %ebx
  801295:	50                   	push   %eax
  801296:	68 8c 22 80 00       	push   $0x80228c
  80129b:	e8 d1 ee ff ff       	call   800171 <cprintf>
		return -E_INVAL;
  8012a0:	83 c4 10             	add    $0x10,%esp
  8012a3:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8012a8:	eb da                	jmp    801284 <ftruncate+0x56>
		return -E_NOT_SUPP;
  8012aa:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  8012af:	eb d3                	jmp    801284 <ftruncate+0x56>

008012b1 <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  8012b1:	f3 0f 1e fb          	endbr32 
  8012b5:	55                   	push   %ebp
  8012b6:	89 e5                	mov    %esp,%ebp
  8012b8:	53                   	push   %ebx
  8012b9:	83 ec 1c             	sub    $0x1c,%esp
  8012bc:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012bf:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012c2:	50                   	push   %eax
  8012c3:	ff 75 08             	pushl  0x8(%ebp)
  8012c6:	e8 57 fb ff ff       	call   800e22 <fd_lookup>
  8012cb:	83 c4 10             	add    $0x10,%esp
  8012ce:	85 c0                	test   %eax,%eax
  8012d0:	78 4b                	js     80131d <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8012d2:	83 ec 08             	sub    $0x8,%esp
  8012d5:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012d8:	50                   	push   %eax
  8012d9:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012dc:	ff 30                	pushl  (%eax)
  8012de:	e8 93 fb ff ff       	call   800e76 <dev_lookup>
  8012e3:	83 c4 10             	add    $0x10,%esp
  8012e6:	85 c0                	test   %eax,%eax
  8012e8:	78 33                	js     80131d <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  8012ea:	8b 45 f4             	mov    -0xc(%ebp),%eax
  8012ed:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  8012f1:	74 2f                	je     801322 <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  8012f3:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  8012f6:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  8012fd:	00 00 00 
	stat->st_isdir = 0;
  801300:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801307:	00 00 00 
	stat->st_dev = dev;
  80130a:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  801310:	83 ec 08             	sub    $0x8,%esp
  801313:	53                   	push   %ebx
  801314:	ff 75 f0             	pushl  -0x10(%ebp)
  801317:	ff 50 14             	call   *0x14(%eax)
  80131a:	83 c4 10             	add    $0x10,%esp
}
  80131d:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801320:	c9                   	leave  
  801321:	c3                   	ret    
		return -E_NOT_SUPP;
  801322:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801327:	eb f4                	jmp    80131d <fstat+0x6c>

00801329 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  801329:	f3 0f 1e fb          	endbr32 
  80132d:	55                   	push   %ebp
  80132e:	89 e5                	mov    %esp,%ebp
  801330:	56                   	push   %esi
  801331:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  801332:	83 ec 08             	sub    $0x8,%esp
  801335:	6a 00                	push   $0x0
  801337:	ff 75 08             	pushl  0x8(%ebp)
  80133a:	e8 fb 01 00 00       	call   80153a <open>
  80133f:	89 c3                	mov    %eax,%ebx
  801341:	83 c4 10             	add    $0x10,%esp
  801344:	85 c0                	test   %eax,%eax
  801346:	78 1b                	js     801363 <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  801348:	83 ec 08             	sub    $0x8,%esp
  80134b:	ff 75 0c             	pushl  0xc(%ebp)
  80134e:	50                   	push   %eax
  80134f:	e8 5d ff ff ff       	call   8012b1 <fstat>
  801354:	89 c6                	mov    %eax,%esi
	close(fd);
  801356:	89 1c 24             	mov    %ebx,(%esp)
  801359:	e8 fd fb ff ff       	call   800f5b <close>
	return r;
  80135e:	83 c4 10             	add    $0x10,%esp
  801361:	89 f3                	mov    %esi,%ebx
}
  801363:	89 d8                	mov    %ebx,%eax
  801365:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801368:	5b                   	pop    %ebx
  801369:	5e                   	pop    %esi
  80136a:	5d                   	pop    %ebp
  80136b:	c3                   	ret    

0080136c <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  80136c:	55                   	push   %ebp
  80136d:	89 e5                	mov    %esp,%ebp
  80136f:	56                   	push   %esi
  801370:	53                   	push   %ebx
  801371:	89 c6                	mov    %eax,%esi
  801373:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  801375:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  80137c:	74 27                	je     8013a5 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  80137e:	6a 07                	push   $0x7
  801380:	68 00 50 80 00       	push   $0x805000
  801385:	56                   	push   %esi
  801386:	ff 35 00 40 80 00    	pushl  0x804000
  80138c:	e8 1c 08 00 00       	call   801bad <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  801391:	83 c4 0c             	add    $0xc,%esp
  801394:	6a 00                	push   $0x0
  801396:	53                   	push   %ebx
  801397:	6a 00                	push   $0x0
  801399:	e8 8e 07 00 00       	call   801b2c <ipc_recv>
}
  80139e:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8013a1:	5b                   	pop    %ebx
  8013a2:	5e                   	pop    %esi
  8013a3:	5d                   	pop    %ebp
  8013a4:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  8013a5:	83 ec 0c             	sub    $0xc,%esp
  8013a8:	6a 01                	push   $0x1
  8013aa:	e8 56 08 00 00       	call   801c05 <ipc_find_env>
  8013af:	a3 00 40 80 00       	mov    %eax,0x804000
  8013b4:	83 c4 10             	add    $0x10,%esp
  8013b7:	eb c5                	jmp    80137e <fsipc+0x12>

008013b9 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  8013b9:	f3 0f 1e fb          	endbr32 
  8013bd:	55                   	push   %ebp
  8013be:	89 e5                	mov    %esp,%ebp
  8013c0:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  8013c3:	8b 45 08             	mov    0x8(%ebp),%eax
  8013c6:	8b 40 0c             	mov    0xc(%eax),%eax
  8013c9:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  8013ce:	8b 45 0c             	mov    0xc(%ebp),%eax
  8013d1:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  8013d6:	ba 00 00 00 00       	mov    $0x0,%edx
  8013db:	b8 02 00 00 00       	mov    $0x2,%eax
  8013e0:	e8 87 ff ff ff       	call   80136c <fsipc>
}
  8013e5:	c9                   	leave  
  8013e6:	c3                   	ret    

008013e7 <devfile_flush>:
{
  8013e7:	f3 0f 1e fb          	endbr32 
  8013eb:	55                   	push   %ebp
  8013ec:	89 e5                	mov    %esp,%ebp
  8013ee:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  8013f1:	8b 45 08             	mov    0x8(%ebp),%eax
  8013f4:	8b 40 0c             	mov    0xc(%eax),%eax
  8013f7:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  8013fc:	ba 00 00 00 00       	mov    $0x0,%edx
  801401:	b8 06 00 00 00       	mov    $0x6,%eax
  801406:	e8 61 ff ff ff       	call   80136c <fsipc>
}
  80140b:	c9                   	leave  
  80140c:	c3                   	ret    

0080140d <devfile_stat>:
{
  80140d:	f3 0f 1e fb          	endbr32 
  801411:	55                   	push   %ebp
  801412:	89 e5                	mov    %esp,%ebp
  801414:	53                   	push   %ebx
  801415:	83 ec 04             	sub    $0x4,%esp
  801418:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  80141b:	8b 45 08             	mov    0x8(%ebp),%eax
  80141e:	8b 40 0c             	mov    0xc(%eax),%eax
  801421:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801426:	ba 00 00 00 00       	mov    $0x0,%edx
  80142b:	b8 05 00 00 00       	mov    $0x5,%eax
  801430:	e8 37 ff ff ff       	call   80136c <fsipc>
  801435:	85 c0                	test   %eax,%eax
  801437:	78 2c                	js     801465 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  801439:	83 ec 08             	sub    $0x8,%esp
  80143c:	68 00 50 80 00       	push   $0x805000
  801441:	53                   	push   %ebx
  801442:	e8 03 f3 ff ff       	call   80074a <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  801447:	a1 80 50 80 00       	mov    0x805080,%eax
  80144c:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  801452:	a1 84 50 80 00       	mov    0x805084,%eax
  801457:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  80145d:	83 c4 10             	add    $0x10,%esp
  801460:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801465:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801468:	c9                   	leave  
  801469:	c3                   	ret    

0080146a <devfile_write>:
{
  80146a:	f3 0f 1e fb          	endbr32 
  80146e:	55                   	push   %ebp
  80146f:	89 e5                	mov    %esp,%ebp
  801471:	83 ec 0c             	sub    $0xc,%esp
  801474:	8b 45 10             	mov    0x10(%ebp),%eax
  801477:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  80147c:	ba f8 0f 00 00       	mov    $0xff8,%edx
  801481:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  801484:	8b 55 08             	mov    0x8(%ebp),%edx
  801487:	8b 52 0c             	mov    0xc(%edx),%edx
  80148a:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  801490:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  801495:	50                   	push   %eax
  801496:	ff 75 0c             	pushl  0xc(%ebp)
  801499:	68 08 50 80 00       	push   $0x805008
  80149e:	e8 5d f4 ff ff       	call   800900 <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8014a3:	ba 00 00 00 00       	mov    $0x0,%edx
  8014a8:	b8 04 00 00 00       	mov    $0x4,%eax
  8014ad:	e8 ba fe ff ff       	call   80136c <fsipc>
  8014b2:	c9                   	leave  
  8014b3:	c3                   	ret    

008014b4 <devfile_read>:
{
  8014b4:	f3 0f 1e fb          	endbr32 
  8014b8:	55                   	push   %ebp
  8014b9:	89 e5                	mov    %esp,%ebp
  8014bb:	56                   	push   %esi
  8014bc:	53                   	push   %ebx
  8014bd:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  8014c0:	8b 45 08             	mov    0x8(%ebp),%eax
  8014c3:	8b 40 0c             	mov    0xc(%eax),%eax
  8014c6:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  8014cb:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  8014d1:	ba 00 00 00 00       	mov    $0x0,%edx
  8014d6:	b8 03 00 00 00       	mov    $0x3,%eax
  8014db:	e8 8c fe ff ff       	call   80136c <fsipc>
  8014e0:	89 c3                	mov    %eax,%ebx
  8014e2:	85 c0                	test   %eax,%eax
  8014e4:	78 1f                	js     801505 <devfile_read+0x51>
	assert(r <= n);
  8014e6:	39 f0                	cmp    %esi,%eax
  8014e8:	77 24                	ja     80150e <devfile_read+0x5a>
	assert(r <= PGSIZE);
  8014ea:	3d 00 10 00 00       	cmp    $0x1000,%eax
  8014ef:	7f 33                	jg     801524 <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  8014f1:	83 ec 04             	sub    $0x4,%esp
  8014f4:	50                   	push   %eax
  8014f5:	68 00 50 80 00       	push   $0x805000
  8014fa:	ff 75 0c             	pushl  0xc(%ebp)
  8014fd:	e8 fe f3 ff ff       	call   800900 <memmove>
	return r;
  801502:	83 c4 10             	add    $0x10,%esp
}
  801505:	89 d8                	mov    %ebx,%eax
  801507:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80150a:	5b                   	pop    %ebx
  80150b:	5e                   	pop    %esi
  80150c:	5d                   	pop    %ebp
  80150d:	c3                   	ret    
	assert(r <= n);
  80150e:	68 f8 22 80 00       	push   $0x8022f8
  801513:	68 ff 22 80 00       	push   $0x8022ff
  801518:	6a 7c                	push   $0x7c
  80151a:	68 14 23 80 00       	push   $0x802314
  80151f:	e8 be 05 00 00       	call   801ae2 <_panic>
	assert(r <= PGSIZE);
  801524:	68 1f 23 80 00       	push   $0x80231f
  801529:	68 ff 22 80 00       	push   $0x8022ff
  80152e:	6a 7d                	push   $0x7d
  801530:	68 14 23 80 00       	push   $0x802314
  801535:	e8 a8 05 00 00       	call   801ae2 <_panic>

0080153a <open>:
{
  80153a:	f3 0f 1e fb          	endbr32 
  80153e:	55                   	push   %ebp
  80153f:	89 e5                	mov    %esp,%ebp
  801541:	56                   	push   %esi
  801542:	53                   	push   %ebx
  801543:	83 ec 1c             	sub    $0x1c,%esp
  801546:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  801549:	56                   	push   %esi
  80154a:	e8 b8 f1 ff ff       	call   800707 <strlen>
  80154f:	83 c4 10             	add    $0x10,%esp
  801552:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  801557:	7f 6c                	jg     8015c5 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  801559:	83 ec 0c             	sub    $0xc,%esp
  80155c:	8d 45 f4             	lea    -0xc(%ebp),%eax
  80155f:	50                   	push   %eax
  801560:	e8 67 f8 ff ff       	call   800dcc <fd_alloc>
  801565:	89 c3                	mov    %eax,%ebx
  801567:	83 c4 10             	add    $0x10,%esp
  80156a:	85 c0                	test   %eax,%eax
  80156c:	78 3c                	js     8015aa <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  80156e:	83 ec 08             	sub    $0x8,%esp
  801571:	56                   	push   %esi
  801572:	68 00 50 80 00       	push   $0x805000
  801577:	e8 ce f1 ff ff       	call   80074a <strcpy>
	fsipcbuf.open.req_omode = mode;
  80157c:	8b 45 0c             	mov    0xc(%ebp),%eax
  80157f:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  801584:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801587:	b8 01 00 00 00       	mov    $0x1,%eax
  80158c:	e8 db fd ff ff       	call   80136c <fsipc>
  801591:	89 c3                	mov    %eax,%ebx
  801593:	83 c4 10             	add    $0x10,%esp
  801596:	85 c0                	test   %eax,%eax
  801598:	78 19                	js     8015b3 <open+0x79>
	return fd2num(fd);
  80159a:	83 ec 0c             	sub    $0xc,%esp
  80159d:	ff 75 f4             	pushl  -0xc(%ebp)
  8015a0:	e8 f8 f7 ff ff       	call   800d9d <fd2num>
  8015a5:	89 c3                	mov    %eax,%ebx
  8015a7:	83 c4 10             	add    $0x10,%esp
}
  8015aa:	89 d8                	mov    %ebx,%eax
  8015ac:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8015af:	5b                   	pop    %ebx
  8015b0:	5e                   	pop    %esi
  8015b1:	5d                   	pop    %ebp
  8015b2:	c3                   	ret    
		fd_close(fd, 0);
  8015b3:	83 ec 08             	sub    $0x8,%esp
  8015b6:	6a 00                	push   $0x0
  8015b8:	ff 75 f4             	pushl  -0xc(%ebp)
  8015bb:	e8 10 f9 ff ff       	call   800ed0 <fd_close>
		return r;
  8015c0:	83 c4 10             	add    $0x10,%esp
  8015c3:	eb e5                	jmp    8015aa <open+0x70>
		return -E_BAD_PATH;
  8015c5:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  8015ca:	eb de                	jmp    8015aa <open+0x70>

008015cc <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  8015cc:	f3 0f 1e fb          	endbr32 
  8015d0:	55                   	push   %ebp
  8015d1:	89 e5                	mov    %esp,%ebp
  8015d3:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  8015d6:	ba 00 00 00 00       	mov    $0x0,%edx
  8015db:	b8 08 00 00 00       	mov    $0x8,%eax
  8015e0:	e8 87 fd ff ff       	call   80136c <fsipc>
}
  8015e5:	c9                   	leave  
  8015e6:	c3                   	ret    

008015e7 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  8015e7:	f3 0f 1e fb          	endbr32 
  8015eb:	55                   	push   %ebp
  8015ec:	89 e5                	mov    %esp,%ebp
  8015ee:	56                   	push   %esi
  8015ef:	53                   	push   %ebx
  8015f0:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  8015f3:	83 ec 0c             	sub    $0xc,%esp
  8015f6:	ff 75 08             	pushl  0x8(%ebp)
  8015f9:	e8 b3 f7 ff ff       	call   800db1 <fd2data>
  8015fe:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  801600:	83 c4 08             	add    $0x8,%esp
  801603:	68 2b 23 80 00       	push   $0x80232b
  801608:	53                   	push   %ebx
  801609:	e8 3c f1 ff ff       	call   80074a <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  80160e:	8b 46 04             	mov    0x4(%esi),%eax
  801611:	2b 06                	sub    (%esi),%eax
  801613:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  801619:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801620:	00 00 00 
	stat->st_dev = &devpipe;
  801623:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  80162a:	30 80 00 
	return 0;
}
  80162d:	b8 00 00 00 00       	mov    $0x0,%eax
  801632:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801635:	5b                   	pop    %ebx
  801636:	5e                   	pop    %esi
  801637:	5d                   	pop    %ebp
  801638:	c3                   	ret    

00801639 <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801639:	f3 0f 1e fb          	endbr32 
  80163d:	55                   	push   %ebp
  80163e:	89 e5                	mov    %esp,%ebp
  801640:	53                   	push   %ebx
  801641:	83 ec 0c             	sub    $0xc,%esp
  801644:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  801647:	53                   	push   %ebx
  801648:	6a 00                	push   $0x0
  80164a:	e8 ca f5 ff ff       	call   800c19 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  80164f:	89 1c 24             	mov    %ebx,(%esp)
  801652:	e8 5a f7 ff ff       	call   800db1 <fd2data>
  801657:	83 c4 08             	add    $0x8,%esp
  80165a:	50                   	push   %eax
  80165b:	6a 00                	push   $0x0
  80165d:	e8 b7 f5 ff ff       	call   800c19 <sys_page_unmap>
}
  801662:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801665:	c9                   	leave  
  801666:	c3                   	ret    

00801667 <_pipeisclosed>:
{
  801667:	55                   	push   %ebp
  801668:	89 e5                	mov    %esp,%ebp
  80166a:	57                   	push   %edi
  80166b:	56                   	push   %esi
  80166c:	53                   	push   %ebx
  80166d:	83 ec 1c             	sub    $0x1c,%esp
  801670:	89 c7                	mov    %eax,%edi
  801672:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  801674:	a1 04 40 80 00       	mov    0x804004,%eax
  801679:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  80167c:	83 ec 0c             	sub    $0xc,%esp
  80167f:	57                   	push   %edi
  801680:	e8 bd 05 00 00       	call   801c42 <pageref>
  801685:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  801688:	89 34 24             	mov    %esi,(%esp)
  80168b:	e8 b2 05 00 00       	call   801c42 <pageref>
		nn = thisenv->env_runs;
  801690:	8b 15 04 40 80 00    	mov    0x804004,%edx
  801696:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  801699:	83 c4 10             	add    $0x10,%esp
  80169c:	39 cb                	cmp    %ecx,%ebx
  80169e:	74 1b                	je     8016bb <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  8016a0:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016a3:	75 cf                	jne    801674 <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  8016a5:	8b 42 58             	mov    0x58(%edx),%eax
  8016a8:	6a 01                	push   $0x1
  8016aa:	50                   	push   %eax
  8016ab:	53                   	push   %ebx
  8016ac:	68 32 23 80 00       	push   $0x802332
  8016b1:	e8 bb ea ff ff       	call   800171 <cprintf>
  8016b6:	83 c4 10             	add    $0x10,%esp
  8016b9:	eb b9                	jmp    801674 <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  8016bb:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8016be:	0f 94 c0             	sete   %al
  8016c1:	0f b6 c0             	movzbl %al,%eax
}
  8016c4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8016c7:	5b                   	pop    %ebx
  8016c8:	5e                   	pop    %esi
  8016c9:	5f                   	pop    %edi
  8016ca:	5d                   	pop    %ebp
  8016cb:	c3                   	ret    

008016cc <devpipe_write>:
{
  8016cc:	f3 0f 1e fb          	endbr32 
  8016d0:	55                   	push   %ebp
  8016d1:	89 e5                	mov    %esp,%ebp
  8016d3:	57                   	push   %edi
  8016d4:	56                   	push   %esi
  8016d5:	53                   	push   %ebx
  8016d6:	83 ec 28             	sub    $0x28,%esp
  8016d9:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  8016dc:	56                   	push   %esi
  8016dd:	e8 cf f6 ff ff       	call   800db1 <fd2data>
  8016e2:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8016e4:	83 c4 10             	add    $0x10,%esp
  8016e7:	bf 00 00 00 00       	mov    $0x0,%edi
  8016ec:	3b 7d 10             	cmp    0x10(%ebp),%edi
  8016ef:	74 4f                	je     801740 <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  8016f1:	8b 43 04             	mov    0x4(%ebx),%eax
  8016f4:	8b 0b                	mov    (%ebx),%ecx
  8016f6:	8d 51 20             	lea    0x20(%ecx),%edx
  8016f9:	39 d0                	cmp    %edx,%eax
  8016fb:	72 14                	jb     801711 <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  8016fd:	89 da                	mov    %ebx,%edx
  8016ff:	89 f0                	mov    %esi,%eax
  801701:	e8 61 ff ff ff       	call   801667 <_pipeisclosed>
  801706:	85 c0                	test   %eax,%eax
  801708:	75 3b                	jne    801745 <devpipe_write+0x79>
			sys_yield();
  80170a:	e8 5a f4 ff ff       	call   800b69 <sys_yield>
  80170f:	eb e0                	jmp    8016f1 <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  801711:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801714:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801718:	88 4d e7             	mov    %cl,-0x19(%ebp)
  80171b:	89 c2                	mov    %eax,%edx
  80171d:	c1 fa 1f             	sar    $0x1f,%edx
  801720:	89 d1                	mov    %edx,%ecx
  801722:	c1 e9 1b             	shr    $0x1b,%ecx
  801725:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801728:	83 e2 1f             	and    $0x1f,%edx
  80172b:	29 ca                	sub    %ecx,%edx
  80172d:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  801731:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801735:	83 c0 01             	add    $0x1,%eax
  801738:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  80173b:	83 c7 01             	add    $0x1,%edi
  80173e:	eb ac                	jmp    8016ec <devpipe_write+0x20>
	return i;
  801740:	8b 45 10             	mov    0x10(%ebp),%eax
  801743:	eb 05                	jmp    80174a <devpipe_write+0x7e>
				return 0;
  801745:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80174a:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80174d:	5b                   	pop    %ebx
  80174e:	5e                   	pop    %esi
  80174f:	5f                   	pop    %edi
  801750:	5d                   	pop    %ebp
  801751:	c3                   	ret    

00801752 <devpipe_read>:
{
  801752:	f3 0f 1e fb          	endbr32 
  801756:	55                   	push   %ebp
  801757:	89 e5                	mov    %esp,%ebp
  801759:	57                   	push   %edi
  80175a:	56                   	push   %esi
  80175b:	53                   	push   %ebx
  80175c:	83 ec 18             	sub    $0x18,%esp
  80175f:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  801762:	57                   	push   %edi
  801763:	e8 49 f6 ff ff       	call   800db1 <fd2data>
  801768:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  80176a:	83 c4 10             	add    $0x10,%esp
  80176d:	be 00 00 00 00       	mov    $0x0,%esi
  801772:	3b 75 10             	cmp    0x10(%ebp),%esi
  801775:	75 14                	jne    80178b <devpipe_read+0x39>
	return i;
  801777:	8b 45 10             	mov    0x10(%ebp),%eax
  80177a:	eb 02                	jmp    80177e <devpipe_read+0x2c>
				return i;
  80177c:	89 f0                	mov    %esi,%eax
}
  80177e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801781:	5b                   	pop    %ebx
  801782:	5e                   	pop    %esi
  801783:	5f                   	pop    %edi
  801784:	5d                   	pop    %ebp
  801785:	c3                   	ret    
			sys_yield();
  801786:	e8 de f3 ff ff       	call   800b69 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  80178b:	8b 03                	mov    (%ebx),%eax
  80178d:	3b 43 04             	cmp    0x4(%ebx),%eax
  801790:	75 18                	jne    8017aa <devpipe_read+0x58>
			if (i > 0)
  801792:	85 f6                	test   %esi,%esi
  801794:	75 e6                	jne    80177c <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  801796:	89 da                	mov    %ebx,%edx
  801798:	89 f8                	mov    %edi,%eax
  80179a:	e8 c8 fe ff ff       	call   801667 <_pipeisclosed>
  80179f:	85 c0                	test   %eax,%eax
  8017a1:	74 e3                	je     801786 <devpipe_read+0x34>
				return 0;
  8017a3:	b8 00 00 00 00       	mov    $0x0,%eax
  8017a8:	eb d4                	jmp    80177e <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  8017aa:	99                   	cltd   
  8017ab:	c1 ea 1b             	shr    $0x1b,%edx
  8017ae:	01 d0                	add    %edx,%eax
  8017b0:	83 e0 1f             	and    $0x1f,%eax
  8017b3:	29 d0                	sub    %edx,%eax
  8017b5:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  8017ba:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  8017bd:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  8017c0:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  8017c3:	83 c6 01             	add    $0x1,%esi
  8017c6:	eb aa                	jmp    801772 <devpipe_read+0x20>

008017c8 <pipe>:
{
  8017c8:	f3 0f 1e fb          	endbr32 
  8017cc:	55                   	push   %ebp
  8017cd:	89 e5                	mov    %esp,%ebp
  8017cf:	56                   	push   %esi
  8017d0:	53                   	push   %ebx
  8017d1:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  8017d4:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8017d7:	50                   	push   %eax
  8017d8:	e8 ef f5 ff ff       	call   800dcc <fd_alloc>
  8017dd:	89 c3                	mov    %eax,%ebx
  8017df:	83 c4 10             	add    $0x10,%esp
  8017e2:	85 c0                	test   %eax,%eax
  8017e4:	0f 88 23 01 00 00    	js     80190d <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8017ea:	83 ec 04             	sub    $0x4,%esp
  8017ed:	68 07 04 00 00       	push   $0x407
  8017f2:	ff 75 f4             	pushl  -0xc(%ebp)
  8017f5:	6a 00                	push   $0x0
  8017f7:	e8 90 f3 ff ff       	call   800b8c <sys_page_alloc>
  8017fc:	89 c3                	mov    %eax,%ebx
  8017fe:	83 c4 10             	add    $0x10,%esp
  801801:	85 c0                	test   %eax,%eax
  801803:	0f 88 04 01 00 00    	js     80190d <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  801809:	83 ec 0c             	sub    $0xc,%esp
  80180c:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80180f:	50                   	push   %eax
  801810:	e8 b7 f5 ff ff       	call   800dcc <fd_alloc>
  801815:	89 c3                	mov    %eax,%ebx
  801817:	83 c4 10             	add    $0x10,%esp
  80181a:	85 c0                	test   %eax,%eax
  80181c:	0f 88 db 00 00 00    	js     8018fd <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801822:	83 ec 04             	sub    $0x4,%esp
  801825:	68 07 04 00 00       	push   $0x407
  80182a:	ff 75 f0             	pushl  -0x10(%ebp)
  80182d:	6a 00                	push   $0x0
  80182f:	e8 58 f3 ff ff       	call   800b8c <sys_page_alloc>
  801834:	89 c3                	mov    %eax,%ebx
  801836:	83 c4 10             	add    $0x10,%esp
  801839:	85 c0                	test   %eax,%eax
  80183b:	0f 88 bc 00 00 00    	js     8018fd <pipe+0x135>
	va = fd2data(fd0);
  801841:	83 ec 0c             	sub    $0xc,%esp
  801844:	ff 75 f4             	pushl  -0xc(%ebp)
  801847:	e8 65 f5 ff ff       	call   800db1 <fd2data>
  80184c:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80184e:	83 c4 0c             	add    $0xc,%esp
  801851:	68 07 04 00 00       	push   $0x407
  801856:	50                   	push   %eax
  801857:	6a 00                	push   $0x0
  801859:	e8 2e f3 ff ff       	call   800b8c <sys_page_alloc>
  80185e:	89 c3                	mov    %eax,%ebx
  801860:	83 c4 10             	add    $0x10,%esp
  801863:	85 c0                	test   %eax,%eax
  801865:	0f 88 82 00 00 00    	js     8018ed <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80186b:	83 ec 0c             	sub    $0xc,%esp
  80186e:	ff 75 f0             	pushl  -0x10(%ebp)
  801871:	e8 3b f5 ff ff       	call   800db1 <fd2data>
  801876:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  80187d:	50                   	push   %eax
  80187e:	6a 00                	push   $0x0
  801880:	56                   	push   %esi
  801881:	6a 00                	push   $0x0
  801883:	e8 4b f3 ff ff       	call   800bd3 <sys_page_map>
  801888:	89 c3                	mov    %eax,%ebx
  80188a:	83 c4 20             	add    $0x20,%esp
  80188d:	85 c0                	test   %eax,%eax
  80188f:	78 4e                	js     8018df <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  801891:	a1 20 30 80 00       	mov    0x803020,%eax
  801896:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801899:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  80189b:	8b 55 f4             	mov    -0xc(%ebp),%edx
  80189e:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  8018a5:	8b 55 f0             	mov    -0x10(%ebp),%edx
  8018a8:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  8018aa:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8018ad:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  8018b4:	83 ec 0c             	sub    $0xc,%esp
  8018b7:	ff 75 f4             	pushl  -0xc(%ebp)
  8018ba:	e8 de f4 ff ff       	call   800d9d <fd2num>
  8018bf:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018c2:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  8018c4:	83 c4 04             	add    $0x4,%esp
  8018c7:	ff 75 f0             	pushl  -0x10(%ebp)
  8018ca:	e8 ce f4 ff ff       	call   800d9d <fd2num>
  8018cf:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8018d2:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  8018d5:	83 c4 10             	add    $0x10,%esp
  8018d8:	bb 00 00 00 00       	mov    $0x0,%ebx
  8018dd:	eb 2e                	jmp    80190d <pipe+0x145>
	sys_page_unmap(0, va);
  8018df:	83 ec 08             	sub    $0x8,%esp
  8018e2:	56                   	push   %esi
  8018e3:	6a 00                	push   $0x0
  8018e5:	e8 2f f3 ff ff       	call   800c19 <sys_page_unmap>
  8018ea:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  8018ed:	83 ec 08             	sub    $0x8,%esp
  8018f0:	ff 75 f0             	pushl  -0x10(%ebp)
  8018f3:	6a 00                	push   $0x0
  8018f5:	e8 1f f3 ff ff       	call   800c19 <sys_page_unmap>
  8018fa:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  8018fd:	83 ec 08             	sub    $0x8,%esp
  801900:	ff 75 f4             	pushl  -0xc(%ebp)
  801903:	6a 00                	push   $0x0
  801905:	e8 0f f3 ff ff       	call   800c19 <sys_page_unmap>
  80190a:	83 c4 10             	add    $0x10,%esp
}
  80190d:	89 d8                	mov    %ebx,%eax
  80190f:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801912:	5b                   	pop    %ebx
  801913:	5e                   	pop    %esi
  801914:	5d                   	pop    %ebp
  801915:	c3                   	ret    

00801916 <pipeisclosed>:
{
  801916:	f3 0f 1e fb          	endbr32 
  80191a:	55                   	push   %ebp
  80191b:	89 e5                	mov    %esp,%ebp
  80191d:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801920:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801923:	50                   	push   %eax
  801924:	ff 75 08             	pushl  0x8(%ebp)
  801927:	e8 f6 f4 ff ff       	call   800e22 <fd_lookup>
  80192c:	83 c4 10             	add    $0x10,%esp
  80192f:	85 c0                	test   %eax,%eax
  801931:	78 18                	js     80194b <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801933:	83 ec 0c             	sub    $0xc,%esp
  801936:	ff 75 f4             	pushl  -0xc(%ebp)
  801939:	e8 73 f4 ff ff       	call   800db1 <fd2data>
  80193e:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801940:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801943:	e8 1f fd ff ff       	call   801667 <_pipeisclosed>
  801948:	83 c4 10             	add    $0x10,%esp
}
  80194b:	c9                   	leave  
  80194c:	c3                   	ret    

0080194d <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  80194d:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801951:	b8 00 00 00 00       	mov    $0x0,%eax
  801956:	c3                   	ret    

00801957 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801957:	f3 0f 1e fb          	endbr32 
  80195b:	55                   	push   %ebp
  80195c:	89 e5                	mov    %esp,%ebp
  80195e:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801961:	68 4a 23 80 00       	push   $0x80234a
  801966:	ff 75 0c             	pushl  0xc(%ebp)
  801969:	e8 dc ed ff ff       	call   80074a <strcpy>
	return 0;
}
  80196e:	b8 00 00 00 00       	mov    $0x0,%eax
  801973:	c9                   	leave  
  801974:	c3                   	ret    

00801975 <devcons_write>:
{
  801975:	f3 0f 1e fb          	endbr32 
  801979:	55                   	push   %ebp
  80197a:	89 e5                	mov    %esp,%ebp
  80197c:	57                   	push   %edi
  80197d:	56                   	push   %esi
  80197e:	53                   	push   %ebx
  80197f:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801985:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  80198a:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  801990:	3b 75 10             	cmp    0x10(%ebp),%esi
  801993:	73 31                	jae    8019c6 <devcons_write+0x51>
		m = n - tot;
  801995:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801998:	29 f3                	sub    %esi,%ebx
  80199a:	83 fb 7f             	cmp    $0x7f,%ebx
  80199d:	b8 7f 00 00 00       	mov    $0x7f,%eax
  8019a2:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  8019a5:	83 ec 04             	sub    $0x4,%esp
  8019a8:	53                   	push   %ebx
  8019a9:	89 f0                	mov    %esi,%eax
  8019ab:	03 45 0c             	add    0xc(%ebp),%eax
  8019ae:	50                   	push   %eax
  8019af:	57                   	push   %edi
  8019b0:	e8 4b ef ff ff       	call   800900 <memmove>
		sys_cputs(buf, m);
  8019b5:	83 c4 08             	add    $0x8,%esp
  8019b8:	53                   	push   %ebx
  8019b9:	57                   	push   %edi
  8019ba:	e8 fd f0 ff ff       	call   800abc <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  8019bf:	01 de                	add    %ebx,%esi
  8019c1:	83 c4 10             	add    $0x10,%esp
  8019c4:	eb ca                	jmp    801990 <devcons_write+0x1b>
}
  8019c6:	89 f0                	mov    %esi,%eax
  8019c8:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8019cb:	5b                   	pop    %ebx
  8019cc:	5e                   	pop    %esi
  8019cd:	5f                   	pop    %edi
  8019ce:	5d                   	pop    %ebp
  8019cf:	c3                   	ret    

008019d0 <devcons_read>:
{
  8019d0:	f3 0f 1e fb          	endbr32 
  8019d4:	55                   	push   %ebp
  8019d5:	89 e5                	mov    %esp,%ebp
  8019d7:	83 ec 08             	sub    $0x8,%esp
  8019da:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  8019df:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  8019e3:	74 21                	je     801a06 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  8019e5:	e8 f4 f0 ff ff       	call   800ade <sys_cgetc>
  8019ea:	85 c0                	test   %eax,%eax
  8019ec:	75 07                	jne    8019f5 <devcons_read+0x25>
		sys_yield();
  8019ee:	e8 76 f1 ff ff       	call   800b69 <sys_yield>
  8019f3:	eb f0                	jmp    8019e5 <devcons_read+0x15>
	if (c < 0)
  8019f5:	78 0f                	js     801a06 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  8019f7:	83 f8 04             	cmp    $0x4,%eax
  8019fa:	74 0c                	je     801a08 <devcons_read+0x38>
	*(char*)vbuf = c;
  8019fc:	8b 55 0c             	mov    0xc(%ebp),%edx
  8019ff:	88 02                	mov    %al,(%edx)
	return 1;
  801a01:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801a06:	c9                   	leave  
  801a07:	c3                   	ret    
		return 0;
  801a08:	b8 00 00 00 00       	mov    $0x0,%eax
  801a0d:	eb f7                	jmp    801a06 <devcons_read+0x36>

00801a0f <cputchar>:
{
  801a0f:	f3 0f 1e fb          	endbr32 
  801a13:	55                   	push   %ebp
  801a14:	89 e5                	mov    %esp,%ebp
  801a16:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801a19:	8b 45 08             	mov    0x8(%ebp),%eax
  801a1c:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801a1f:	6a 01                	push   $0x1
  801a21:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a24:	50                   	push   %eax
  801a25:	e8 92 f0 ff ff       	call   800abc <sys_cputs>
}
  801a2a:	83 c4 10             	add    $0x10,%esp
  801a2d:	c9                   	leave  
  801a2e:	c3                   	ret    

00801a2f <getchar>:
{
  801a2f:	f3 0f 1e fb          	endbr32 
  801a33:	55                   	push   %ebp
  801a34:	89 e5                	mov    %esp,%ebp
  801a36:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801a39:	6a 01                	push   $0x1
  801a3b:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801a3e:	50                   	push   %eax
  801a3f:	6a 00                	push   $0x0
  801a41:	e8 5f f6 ff ff       	call   8010a5 <read>
	if (r < 0)
  801a46:	83 c4 10             	add    $0x10,%esp
  801a49:	85 c0                	test   %eax,%eax
  801a4b:	78 06                	js     801a53 <getchar+0x24>
	if (r < 1)
  801a4d:	74 06                	je     801a55 <getchar+0x26>
	return c;
  801a4f:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801a53:	c9                   	leave  
  801a54:	c3                   	ret    
		return -E_EOF;
  801a55:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801a5a:	eb f7                	jmp    801a53 <getchar+0x24>

00801a5c <iscons>:
{
  801a5c:	f3 0f 1e fb          	endbr32 
  801a60:	55                   	push   %ebp
  801a61:	89 e5                	mov    %esp,%ebp
  801a63:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801a66:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a69:	50                   	push   %eax
  801a6a:	ff 75 08             	pushl  0x8(%ebp)
  801a6d:	e8 b0 f3 ff ff       	call   800e22 <fd_lookup>
  801a72:	83 c4 10             	add    $0x10,%esp
  801a75:	85 c0                	test   %eax,%eax
  801a77:	78 11                	js     801a8a <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801a79:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801a7c:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801a82:	39 10                	cmp    %edx,(%eax)
  801a84:	0f 94 c0             	sete   %al
  801a87:	0f b6 c0             	movzbl %al,%eax
}
  801a8a:	c9                   	leave  
  801a8b:	c3                   	ret    

00801a8c <opencons>:
{
  801a8c:	f3 0f 1e fb          	endbr32 
  801a90:	55                   	push   %ebp
  801a91:	89 e5                	mov    %esp,%ebp
  801a93:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801a96:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a99:	50                   	push   %eax
  801a9a:	e8 2d f3 ff ff       	call   800dcc <fd_alloc>
  801a9f:	83 c4 10             	add    $0x10,%esp
  801aa2:	85 c0                	test   %eax,%eax
  801aa4:	78 3a                	js     801ae0 <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801aa6:	83 ec 04             	sub    $0x4,%esp
  801aa9:	68 07 04 00 00       	push   $0x407
  801aae:	ff 75 f4             	pushl  -0xc(%ebp)
  801ab1:	6a 00                	push   $0x0
  801ab3:	e8 d4 f0 ff ff       	call   800b8c <sys_page_alloc>
  801ab8:	83 c4 10             	add    $0x10,%esp
  801abb:	85 c0                	test   %eax,%eax
  801abd:	78 21                	js     801ae0 <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801abf:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801ac2:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801ac8:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801aca:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801acd:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801ad4:	83 ec 0c             	sub    $0xc,%esp
  801ad7:	50                   	push   %eax
  801ad8:	e8 c0 f2 ff ff       	call   800d9d <fd2num>
  801add:	83 c4 10             	add    $0x10,%esp
}
  801ae0:	c9                   	leave  
  801ae1:	c3                   	ret    

00801ae2 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  801ae2:	f3 0f 1e fb          	endbr32 
  801ae6:	55                   	push   %ebp
  801ae7:	89 e5                	mov    %esp,%ebp
  801ae9:	56                   	push   %esi
  801aea:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  801aeb:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  801aee:	8b 35 00 30 80 00    	mov    0x803000,%esi
  801af4:	e8 4d f0 ff ff       	call   800b46 <sys_getenvid>
  801af9:	83 ec 0c             	sub    $0xc,%esp
  801afc:	ff 75 0c             	pushl  0xc(%ebp)
  801aff:	ff 75 08             	pushl  0x8(%ebp)
  801b02:	56                   	push   %esi
  801b03:	50                   	push   %eax
  801b04:	68 58 23 80 00       	push   $0x802358
  801b09:	e8 63 e6 ff ff       	call   800171 <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  801b0e:	83 c4 18             	add    $0x18,%esp
  801b11:	53                   	push   %ebx
  801b12:	ff 75 10             	pushl  0x10(%ebp)
  801b15:	e8 02 e6 ff ff       	call   80011c <vcprintf>
	cprintf("\n");
  801b1a:	c7 04 24 43 23 80 00 	movl   $0x802343,(%esp)
  801b21:	e8 4b e6 ff ff       	call   800171 <cprintf>
  801b26:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  801b29:	cc                   	int3   
  801b2a:	eb fd                	jmp    801b29 <_panic+0x47>

00801b2c <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801b2c:	f3 0f 1e fb          	endbr32 
  801b30:	55                   	push   %ebp
  801b31:	89 e5                	mov    %esp,%ebp
  801b33:	56                   	push   %esi
  801b34:	53                   	push   %ebx
  801b35:	8b 75 08             	mov    0x8(%ebp),%esi
  801b38:	8b 45 0c             	mov    0xc(%ebp),%eax
  801b3b:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801b3e:	85 c0                	test   %eax,%eax
  801b40:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801b45:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801b48:	83 ec 0c             	sub    $0xc,%esp
  801b4b:	50                   	push   %eax
  801b4c:	e8 07 f2 ff ff       	call   800d58 <sys_ipc_recv>
  801b51:	83 c4 10             	add    $0x10,%esp
  801b54:	85 c0                	test   %eax,%eax
  801b56:	78 3f                	js     801b97 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801b58:	e8 e9 ef ff ff       	call   800b46 <sys_getenvid>
  801b5d:	25 ff 03 00 00       	and    $0x3ff,%eax
  801b62:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801b65:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801b6b:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801b71:	85 f6                	test   %esi,%esi
  801b73:	74 05                	je     801b7a <ipc_recv+0x4e>
  801b75:	8b 42 74             	mov    0x74(%edx),%eax
  801b78:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801b7a:	85 db                	test   %ebx,%ebx
  801b7c:	74 0a                	je     801b88 <ipc_recv+0x5c>
  801b7e:	a1 04 40 80 00       	mov    0x804004,%eax
  801b83:	8b 40 78             	mov    0x78(%eax),%eax
  801b86:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801b88:	a1 04 40 80 00       	mov    0x804004,%eax
  801b8d:	8b 40 70             	mov    0x70(%eax),%eax
}
  801b90:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801b93:	5b                   	pop    %ebx
  801b94:	5e                   	pop    %esi
  801b95:	5d                   	pop    %ebp
  801b96:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801b97:	85 f6                	test   %esi,%esi
  801b99:	74 06                	je     801ba1 <ipc_recv+0x75>
  801b9b:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801ba1:	85 db                	test   %ebx,%ebx
  801ba3:	74 eb                	je     801b90 <ipc_recv+0x64>
  801ba5:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801bab:	eb e3                	jmp    801b90 <ipc_recv+0x64>

00801bad <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801bad:	f3 0f 1e fb          	endbr32 
  801bb1:	55                   	push   %ebp
  801bb2:	89 e5                	mov    %esp,%ebp
  801bb4:	57                   	push   %edi
  801bb5:	56                   	push   %esi
  801bb6:	53                   	push   %ebx
  801bb7:	83 ec 0c             	sub    $0xc,%esp
  801bba:	8b 7d 08             	mov    0x8(%ebp),%edi
  801bbd:	8b 75 0c             	mov    0xc(%ebp),%esi
  801bc0:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801bc3:	85 db                	test   %ebx,%ebx
  801bc5:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801bca:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801bcd:	ff 75 14             	pushl  0x14(%ebp)
  801bd0:	53                   	push   %ebx
  801bd1:	56                   	push   %esi
  801bd2:	57                   	push   %edi
  801bd3:	e8 59 f1 ff ff       	call   800d31 <sys_ipc_try_send>
  801bd8:	83 c4 10             	add    $0x10,%esp
  801bdb:	85 c0                	test   %eax,%eax
  801bdd:	79 1e                	jns    801bfd <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801bdf:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801be2:	75 07                	jne    801beb <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801be4:	e8 80 ef ff ff       	call   800b69 <sys_yield>
  801be9:	eb e2                	jmp    801bcd <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801beb:	50                   	push   %eax
  801bec:	68 7b 23 80 00       	push   $0x80237b
  801bf1:	6a 3b                	push   $0x3b
  801bf3:	68 8f 23 80 00       	push   $0x80238f
  801bf8:	e8 e5 fe ff ff       	call   801ae2 <_panic>
	}
}
  801bfd:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801c00:	5b                   	pop    %ebx
  801c01:	5e                   	pop    %esi
  801c02:	5f                   	pop    %edi
  801c03:	5d                   	pop    %ebp
  801c04:	c3                   	ret    

00801c05 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801c05:	f3 0f 1e fb          	endbr32 
  801c09:	55                   	push   %ebp
  801c0a:	89 e5                	mov    %esp,%ebp
  801c0c:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801c0f:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801c14:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801c17:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801c1d:	8b 52 50             	mov    0x50(%edx),%edx
  801c20:	39 ca                	cmp    %ecx,%edx
  801c22:	74 11                	je     801c35 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801c24:	83 c0 01             	add    $0x1,%eax
  801c27:	3d 00 04 00 00       	cmp    $0x400,%eax
  801c2c:	75 e6                	jne    801c14 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801c2e:	b8 00 00 00 00       	mov    $0x0,%eax
  801c33:	eb 0b                	jmp    801c40 <ipc_find_env+0x3b>
			return envs[i].env_id;
  801c35:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801c38:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801c3d:	8b 40 48             	mov    0x48(%eax),%eax
}
  801c40:	5d                   	pop    %ebp
  801c41:	c3                   	ret    

00801c42 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801c42:	f3 0f 1e fb          	endbr32 
  801c46:	55                   	push   %ebp
  801c47:	89 e5                	mov    %esp,%ebp
  801c49:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801c4c:	89 c2                	mov    %eax,%edx
  801c4e:	c1 ea 16             	shr    $0x16,%edx
  801c51:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801c58:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801c5d:	f6 c1 01             	test   $0x1,%cl
  801c60:	74 1c                	je     801c7e <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801c62:	c1 e8 0c             	shr    $0xc,%eax
  801c65:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801c6c:	a8 01                	test   $0x1,%al
  801c6e:	74 0e                	je     801c7e <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801c70:	c1 e8 0c             	shr    $0xc,%eax
  801c73:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801c7a:	ef 
  801c7b:	0f b7 d2             	movzwl %dx,%edx
}
  801c7e:	89 d0                	mov    %edx,%eax
  801c80:	5d                   	pop    %ebp
  801c81:	c3                   	ret    
  801c82:	66 90                	xchg   %ax,%ax
  801c84:	66 90                	xchg   %ax,%ax
  801c86:	66 90                	xchg   %ax,%ax
  801c88:	66 90                	xchg   %ax,%ax
  801c8a:	66 90                	xchg   %ax,%ax
  801c8c:	66 90                	xchg   %ax,%ax
  801c8e:	66 90                	xchg   %ax,%ax

00801c90 <__udivdi3>:
  801c90:	f3 0f 1e fb          	endbr32 
  801c94:	55                   	push   %ebp
  801c95:	57                   	push   %edi
  801c96:	56                   	push   %esi
  801c97:	53                   	push   %ebx
  801c98:	83 ec 1c             	sub    $0x1c,%esp
  801c9b:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801c9f:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801ca3:	8b 74 24 34          	mov    0x34(%esp),%esi
  801ca7:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801cab:	85 d2                	test   %edx,%edx
  801cad:	75 19                	jne    801cc8 <__udivdi3+0x38>
  801caf:	39 f3                	cmp    %esi,%ebx
  801cb1:	76 4d                	jbe    801d00 <__udivdi3+0x70>
  801cb3:	31 ff                	xor    %edi,%edi
  801cb5:	89 e8                	mov    %ebp,%eax
  801cb7:	89 f2                	mov    %esi,%edx
  801cb9:	f7 f3                	div    %ebx
  801cbb:	89 fa                	mov    %edi,%edx
  801cbd:	83 c4 1c             	add    $0x1c,%esp
  801cc0:	5b                   	pop    %ebx
  801cc1:	5e                   	pop    %esi
  801cc2:	5f                   	pop    %edi
  801cc3:	5d                   	pop    %ebp
  801cc4:	c3                   	ret    
  801cc5:	8d 76 00             	lea    0x0(%esi),%esi
  801cc8:	39 f2                	cmp    %esi,%edx
  801cca:	76 14                	jbe    801ce0 <__udivdi3+0x50>
  801ccc:	31 ff                	xor    %edi,%edi
  801cce:	31 c0                	xor    %eax,%eax
  801cd0:	89 fa                	mov    %edi,%edx
  801cd2:	83 c4 1c             	add    $0x1c,%esp
  801cd5:	5b                   	pop    %ebx
  801cd6:	5e                   	pop    %esi
  801cd7:	5f                   	pop    %edi
  801cd8:	5d                   	pop    %ebp
  801cd9:	c3                   	ret    
  801cda:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801ce0:	0f bd fa             	bsr    %edx,%edi
  801ce3:	83 f7 1f             	xor    $0x1f,%edi
  801ce6:	75 48                	jne    801d30 <__udivdi3+0xa0>
  801ce8:	39 f2                	cmp    %esi,%edx
  801cea:	72 06                	jb     801cf2 <__udivdi3+0x62>
  801cec:	31 c0                	xor    %eax,%eax
  801cee:	39 eb                	cmp    %ebp,%ebx
  801cf0:	77 de                	ja     801cd0 <__udivdi3+0x40>
  801cf2:	b8 01 00 00 00       	mov    $0x1,%eax
  801cf7:	eb d7                	jmp    801cd0 <__udivdi3+0x40>
  801cf9:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d00:	89 d9                	mov    %ebx,%ecx
  801d02:	85 db                	test   %ebx,%ebx
  801d04:	75 0b                	jne    801d11 <__udivdi3+0x81>
  801d06:	b8 01 00 00 00       	mov    $0x1,%eax
  801d0b:	31 d2                	xor    %edx,%edx
  801d0d:	f7 f3                	div    %ebx
  801d0f:	89 c1                	mov    %eax,%ecx
  801d11:	31 d2                	xor    %edx,%edx
  801d13:	89 f0                	mov    %esi,%eax
  801d15:	f7 f1                	div    %ecx
  801d17:	89 c6                	mov    %eax,%esi
  801d19:	89 e8                	mov    %ebp,%eax
  801d1b:	89 f7                	mov    %esi,%edi
  801d1d:	f7 f1                	div    %ecx
  801d1f:	89 fa                	mov    %edi,%edx
  801d21:	83 c4 1c             	add    $0x1c,%esp
  801d24:	5b                   	pop    %ebx
  801d25:	5e                   	pop    %esi
  801d26:	5f                   	pop    %edi
  801d27:	5d                   	pop    %ebp
  801d28:	c3                   	ret    
  801d29:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801d30:	89 f9                	mov    %edi,%ecx
  801d32:	b8 20 00 00 00       	mov    $0x20,%eax
  801d37:	29 f8                	sub    %edi,%eax
  801d39:	d3 e2                	shl    %cl,%edx
  801d3b:	89 54 24 08          	mov    %edx,0x8(%esp)
  801d3f:	89 c1                	mov    %eax,%ecx
  801d41:	89 da                	mov    %ebx,%edx
  801d43:	d3 ea                	shr    %cl,%edx
  801d45:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801d49:	09 d1                	or     %edx,%ecx
  801d4b:	89 f2                	mov    %esi,%edx
  801d4d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801d51:	89 f9                	mov    %edi,%ecx
  801d53:	d3 e3                	shl    %cl,%ebx
  801d55:	89 c1                	mov    %eax,%ecx
  801d57:	d3 ea                	shr    %cl,%edx
  801d59:	89 f9                	mov    %edi,%ecx
  801d5b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801d5f:	89 eb                	mov    %ebp,%ebx
  801d61:	d3 e6                	shl    %cl,%esi
  801d63:	89 c1                	mov    %eax,%ecx
  801d65:	d3 eb                	shr    %cl,%ebx
  801d67:	09 de                	or     %ebx,%esi
  801d69:	89 f0                	mov    %esi,%eax
  801d6b:	f7 74 24 08          	divl   0x8(%esp)
  801d6f:	89 d6                	mov    %edx,%esi
  801d71:	89 c3                	mov    %eax,%ebx
  801d73:	f7 64 24 0c          	mull   0xc(%esp)
  801d77:	39 d6                	cmp    %edx,%esi
  801d79:	72 15                	jb     801d90 <__udivdi3+0x100>
  801d7b:	89 f9                	mov    %edi,%ecx
  801d7d:	d3 e5                	shl    %cl,%ebp
  801d7f:	39 c5                	cmp    %eax,%ebp
  801d81:	73 04                	jae    801d87 <__udivdi3+0xf7>
  801d83:	39 d6                	cmp    %edx,%esi
  801d85:	74 09                	je     801d90 <__udivdi3+0x100>
  801d87:	89 d8                	mov    %ebx,%eax
  801d89:	31 ff                	xor    %edi,%edi
  801d8b:	e9 40 ff ff ff       	jmp    801cd0 <__udivdi3+0x40>
  801d90:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801d93:	31 ff                	xor    %edi,%edi
  801d95:	e9 36 ff ff ff       	jmp    801cd0 <__udivdi3+0x40>
  801d9a:	66 90                	xchg   %ax,%ax
  801d9c:	66 90                	xchg   %ax,%ax
  801d9e:	66 90                	xchg   %ax,%ax

00801da0 <__umoddi3>:
  801da0:	f3 0f 1e fb          	endbr32 
  801da4:	55                   	push   %ebp
  801da5:	57                   	push   %edi
  801da6:	56                   	push   %esi
  801da7:	53                   	push   %ebx
  801da8:	83 ec 1c             	sub    $0x1c,%esp
  801dab:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801daf:	8b 74 24 30          	mov    0x30(%esp),%esi
  801db3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801db7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801dbb:	85 c0                	test   %eax,%eax
  801dbd:	75 19                	jne    801dd8 <__umoddi3+0x38>
  801dbf:	39 df                	cmp    %ebx,%edi
  801dc1:	76 5d                	jbe    801e20 <__umoddi3+0x80>
  801dc3:	89 f0                	mov    %esi,%eax
  801dc5:	89 da                	mov    %ebx,%edx
  801dc7:	f7 f7                	div    %edi
  801dc9:	89 d0                	mov    %edx,%eax
  801dcb:	31 d2                	xor    %edx,%edx
  801dcd:	83 c4 1c             	add    $0x1c,%esp
  801dd0:	5b                   	pop    %ebx
  801dd1:	5e                   	pop    %esi
  801dd2:	5f                   	pop    %edi
  801dd3:	5d                   	pop    %ebp
  801dd4:	c3                   	ret    
  801dd5:	8d 76 00             	lea    0x0(%esi),%esi
  801dd8:	89 f2                	mov    %esi,%edx
  801dda:	39 d8                	cmp    %ebx,%eax
  801ddc:	76 12                	jbe    801df0 <__umoddi3+0x50>
  801dde:	89 f0                	mov    %esi,%eax
  801de0:	89 da                	mov    %ebx,%edx
  801de2:	83 c4 1c             	add    $0x1c,%esp
  801de5:	5b                   	pop    %ebx
  801de6:	5e                   	pop    %esi
  801de7:	5f                   	pop    %edi
  801de8:	5d                   	pop    %ebp
  801de9:	c3                   	ret    
  801dea:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801df0:	0f bd e8             	bsr    %eax,%ebp
  801df3:	83 f5 1f             	xor    $0x1f,%ebp
  801df6:	75 50                	jne    801e48 <__umoddi3+0xa8>
  801df8:	39 d8                	cmp    %ebx,%eax
  801dfa:	0f 82 e0 00 00 00    	jb     801ee0 <__umoddi3+0x140>
  801e00:	89 d9                	mov    %ebx,%ecx
  801e02:	39 f7                	cmp    %esi,%edi
  801e04:	0f 86 d6 00 00 00    	jbe    801ee0 <__umoddi3+0x140>
  801e0a:	89 d0                	mov    %edx,%eax
  801e0c:	89 ca                	mov    %ecx,%edx
  801e0e:	83 c4 1c             	add    $0x1c,%esp
  801e11:	5b                   	pop    %ebx
  801e12:	5e                   	pop    %esi
  801e13:	5f                   	pop    %edi
  801e14:	5d                   	pop    %ebp
  801e15:	c3                   	ret    
  801e16:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e1d:	8d 76 00             	lea    0x0(%esi),%esi
  801e20:	89 fd                	mov    %edi,%ebp
  801e22:	85 ff                	test   %edi,%edi
  801e24:	75 0b                	jne    801e31 <__umoddi3+0x91>
  801e26:	b8 01 00 00 00       	mov    $0x1,%eax
  801e2b:	31 d2                	xor    %edx,%edx
  801e2d:	f7 f7                	div    %edi
  801e2f:	89 c5                	mov    %eax,%ebp
  801e31:	89 d8                	mov    %ebx,%eax
  801e33:	31 d2                	xor    %edx,%edx
  801e35:	f7 f5                	div    %ebp
  801e37:	89 f0                	mov    %esi,%eax
  801e39:	f7 f5                	div    %ebp
  801e3b:	89 d0                	mov    %edx,%eax
  801e3d:	31 d2                	xor    %edx,%edx
  801e3f:	eb 8c                	jmp    801dcd <__umoddi3+0x2d>
  801e41:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e48:	89 e9                	mov    %ebp,%ecx
  801e4a:	ba 20 00 00 00       	mov    $0x20,%edx
  801e4f:	29 ea                	sub    %ebp,%edx
  801e51:	d3 e0                	shl    %cl,%eax
  801e53:	89 44 24 08          	mov    %eax,0x8(%esp)
  801e57:	89 d1                	mov    %edx,%ecx
  801e59:	89 f8                	mov    %edi,%eax
  801e5b:	d3 e8                	shr    %cl,%eax
  801e5d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801e61:	89 54 24 04          	mov    %edx,0x4(%esp)
  801e65:	8b 54 24 04          	mov    0x4(%esp),%edx
  801e69:	09 c1                	or     %eax,%ecx
  801e6b:	89 d8                	mov    %ebx,%eax
  801e6d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801e71:	89 e9                	mov    %ebp,%ecx
  801e73:	d3 e7                	shl    %cl,%edi
  801e75:	89 d1                	mov    %edx,%ecx
  801e77:	d3 e8                	shr    %cl,%eax
  801e79:	89 e9                	mov    %ebp,%ecx
  801e7b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801e7f:	d3 e3                	shl    %cl,%ebx
  801e81:	89 c7                	mov    %eax,%edi
  801e83:	89 d1                	mov    %edx,%ecx
  801e85:	89 f0                	mov    %esi,%eax
  801e87:	d3 e8                	shr    %cl,%eax
  801e89:	89 e9                	mov    %ebp,%ecx
  801e8b:	89 fa                	mov    %edi,%edx
  801e8d:	d3 e6                	shl    %cl,%esi
  801e8f:	09 d8                	or     %ebx,%eax
  801e91:	f7 74 24 08          	divl   0x8(%esp)
  801e95:	89 d1                	mov    %edx,%ecx
  801e97:	89 f3                	mov    %esi,%ebx
  801e99:	f7 64 24 0c          	mull   0xc(%esp)
  801e9d:	89 c6                	mov    %eax,%esi
  801e9f:	89 d7                	mov    %edx,%edi
  801ea1:	39 d1                	cmp    %edx,%ecx
  801ea3:	72 06                	jb     801eab <__umoddi3+0x10b>
  801ea5:	75 10                	jne    801eb7 <__umoddi3+0x117>
  801ea7:	39 c3                	cmp    %eax,%ebx
  801ea9:	73 0c                	jae    801eb7 <__umoddi3+0x117>
  801eab:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801eaf:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801eb3:	89 d7                	mov    %edx,%edi
  801eb5:	89 c6                	mov    %eax,%esi
  801eb7:	89 ca                	mov    %ecx,%edx
  801eb9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801ebe:	29 f3                	sub    %esi,%ebx
  801ec0:	19 fa                	sbb    %edi,%edx
  801ec2:	89 d0                	mov    %edx,%eax
  801ec4:	d3 e0                	shl    %cl,%eax
  801ec6:	89 e9                	mov    %ebp,%ecx
  801ec8:	d3 eb                	shr    %cl,%ebx
  801eca:	d3 ea                	shr    %cl,%edx
  801ecc:	09 d8                	or     %ebx,%eax
  801ece:	83 c4 1c             	add    $0x1c,%esp
  801ed1:	5b                   	pop    %ebx
  801ed2:	5e                   	pop    %esi
  801ed3:	5f                   	pop    %edi
  801ed4:	5d                   	pop    %ebp
  801ed5:	c3                   	ret    
  801ed6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801edd:	8d 76 00             	lea    0x0(%esi),%esi
  801ee0:	29 fe                	sub    %edi,%esi
  801ee2:	19 c3                	sbb    %eax,%ebx
  801ee4:	89 f2                	mov    %esi,%edx
  801ee6:	89 d9                	mov    %ebx,%ecx
  801ee8:	e9 1d ff ff ff       	jmp    801e0a <__umoddi3+0x6a>
